diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml index 3df8d45d62..4639b0d5f2 100644 --- a/src/android/app/src/main/AndroidManifest.xml +++ b/src/android/app/src/main/AndroidManifest.xml @@ -29,6 +29,7 @@ + requestNotificationPermissionLauncher = + registerForActivityResult(new ActivityResultContracts.RequestPermission(), isGranted -> { }); + @Override protected void onCreate(Bundle savedInstanceState) { SplashScreen splashScreen = SplashScreen.installSplashScreen(this); @@ -165,6 +172,12 @@ public final class MainActivity extends AppCompatActivity implements MainView { EmulationActivity.tryDismissRunningNotification(this); setInsets(); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) { + requestNotificationPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS); + } + } } @Override