DEV Community

Kay Gosho
Kay Gosho

Posted on

Getting initial notification in React Native

Getting initial notification in React Native seems not to work RN 0.59.x.

I'll try to find a solution. current possible solutions in my mind are:

1. Save userData in didReceiveRemoteNotification

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
  [RNCPushNotificationIOS didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];

  // save userData to somewhere

2. Build a native module

Accessing userData via Native modules. It seems that we can access to userData after app launch.

UIApplicationLaunchOptionsRemoteNotificationKey not getting userinfo -

Top comments (1)

acro5piano profile image
Kay Gosho

I solved. Our marketing tool saves data as deeplink, so notification couldn't get the data