Linking.getInitialUrl() returns null when opening the app from a local notification from react-native-push-notifications

Viewed 211

I have implemented react-native-push-notification to show localNotification from a RemoteMessage that I receive from FCM. I receive the notification but on tapping the notification, Linking.getInitialUrl() returns null. I also have react-native-bootsplash integrated for a splash screen. All the integration is as shown below.

AndroidManifest.xml

...
<activity android:name=".MainActivity" android:label="@string/app_name" 
  android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" 
  android:exported="true" android:launchMode="singleTask" 
  android:windowSoftInputMode="adjustResize">
  <intent-filter>
    <action android:name="android.intent.action.VIEW"/>
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
  </intent-filter>
</activity>

<activity android:name="com.zoontek.rnbootsplash.RNBootSplashActivity" 
  android:theme="@style/BootTheme" android:launchMode="singleTask">
  <intent-filter>
    <action android:name="android.intent.action.MAIN"/>
    <category android:name="android.intent.category.LAUNCHER"/>
  </intent-filter>
</activity>
...

MainActivity.java

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    RNBootSplash.init(R.drawable.bootsplash, MainActivity.this);
  }

It seems that the data associated with the notification intent is not being sent to the Activity. So I am not able to find as to how I send the data.

0 Answers
Related