API 30 and below onNewIntent() is not triggered whenapp is in background

26 Views Asked by At

I use Firebase, Braze, Insider in my app to send notifications. Above API 30 there is no problem. On devices with Android API 30 and below, when the application is open in the background or in the front, when I click on the notification, MainActivity onNewIntent() is not triggered and this only happens in Insider notifications. This problem does not occur when I send an Insider notification to the same device in a different project. Insider and Braze use FCM in the background. Firebase and Braze do not have this problem either. I wonder where the problem is?

  <activity
            android:name=".ui.MainActivity"
            android:exported="true"
            android:launchMode="singleTask"
            android:screenOrientation="sensorPortrait"
            android:stateNotNeeded="true"
            android:windowSoftInputMode="stateVisible|adjustPan">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

For launchMode, I tried both SingleTop and SingleTask, the result did not change.

As an alternative solution, is there any other way to understand whether Firebase Cloud Messaging notifications have been clicked?

0

There are 0 best solutions below