How do I call the launchOptions for iOS in reactnative - ios

I have a push notification, and I want to get the content of the push notification when I click the push notification to run the application. What should I do?

The didFinishLaunchingWithOptions method is called automatically while pressing the notification banner opens your application (If its not already opened). See this for more.
What I think you need is to bridge between RN code and iOS native code (ObjC or swift) on the notification press action. This article might help

Related

iOS when receive a remote notification can we know it and do something?

There is several situations when receiving a remote notification:
app is not launched at all
app is foreground
app is background
what I am looking for is that user haven't click the notification to launch or active the app. can we catch the receiving and do some thing in such three situation?
I know 2 is ok, how about 1 and 3, and how to do it? thx a lot.
somebody mentions widget or NotificationService? is it possible?
You can try adding a Notification Service Extension to your app.
iOS will launch your extension (NOT your app) in background when it receives a push notification. Obviously what you can do inside an extension is fairly limited.
There are two ways to be notified when your app moves to the background: implement the applicationWillResignActive() method in your app delegate, or register for the UIApplication.willResignActiveNotification notification anywhere in your app. This particular notification is sent as soon as your app loses focus, meaning that it's triggered when the user taps the home button once (to return to the home screen) or double taps the home button (to enter multi-tasking).

Get data from push notification (FCM) without do click in notification

I already can manage push notifications from FCM when the app is in Foreground or background, when I do click in notification popup and open app "application didReceiveRemoteNotification" work without problem
My problem is that i don't know how get notification push data if the user open the app normaly (do click in icon app instead of click in notification) and I would lost the data if he close the notification
If the app is in background state UINotification called application didReceiveRemoteNotification , If app is in open state UINotification called application:didFinishLaunchingWithOptions, And can't possible to get data without click on notification in iOS.
check
UIApplicationLaunchOptionsRemoteNotificationKey
or
application:didFinishLaunchingWithOptions

ios 10 Notifications click does nothing

My code for notification execution is present in didRecieveRemoteNotification method in AppDelegate.
When a notification comes and is clicked on, the action is performed in iOS9 and iOS8, but in iOS10 nothing happens. On clicking the notification the app just opens.
I know this can be fixed with the new functions available in Xcode8 but what is the reason it is not working here?
I have seen some other apps, whose notifications work in iOS10 properly
Please see https://forums.developer.apple.com/message/169625#169625.
Apparently, iOS 10 doesn't call the method:
application:didReceiveRemoteNotification:fetchCompletionHandler:
Instead, it calls
application:didReceiveRemoteNotification:

iOS Push Notification open different app

Can IOS push notifications open another app via its URL scheme (ie. SOMEAPP://someUrlScheme)?
I've looked through the documentation but haven't seen any mention of this.
Directly from the notification bar I think it is not possible, but you can handle notification received event show a popup and launch another app on click event of that popup

How to tell whether user opened app with notification with iOS 7 remote-notification background mode?

According to didReceiveRemoteNotification when in background , we used to be able to handle the user opening the app by clicking the action button on a push notification (or swiping on the push notification, depending on how the user sees push notifications) by implementing -application:didReceiveRemoteNotification: and then checking inside the method whether the application's applicationState was not active.
In iOS 7, there's the new remote-notification background mode, which allows the app to perform background fetch when a remote notification is displayed to the user (without the user necessarily doing anything to the notification). To support this mode, you are supposed to implement the -application:didReceiveRemoteNotification:fetchCompletionHandler: method.
The documentation for -application:didReceiveRemoteNotification: says that if your application delegate implements the application:didReceiveRemoteNotification:fetchCompletionHandler: method, then "the app object calls that method instead of this one." Which means we cannot use -application:didReceiveRemoteNotification: to handle remote notifications anymore, since it's not going to be called.
We should probably put handling logic in application:didReceiveRemoteNotification:fetchCompletionHandler:, but the previous trick for handling it doesn't make sense anymore -- previously, we depended on the fact that the only way for -application:didReceiveRemoteNotification: to be called when the app is not active was if the user tapped the action button on the notification to open the app. However, now, the whole point of the remote-notification background mode is that it can call application:didReceiveRemoteNotification:fetchCompletionHandler: in the background every time a remote notification is received, before the user does anything to it.
So then, how can we now tell when the user opens the app using the action button on the notification?
You still check the application state in application:didReceiveRemoteNotification:fetchCompletionHandler:
UIApplicationStateBackground - App is in the background receiving a push notification
UIApplicationStateInactive - App is opening from the user tapping a notification
I was use this delegate function to add the 『Notification Number』.
Cause our Server not send the Badge to our Clients.
Then I used the strange method to add the 『Notification Number』 with this delegate function, and I also add a code to switch UIViewController in this function.
I found out when I use the server push Notification to my test App, and the status of test App is in the background, even I am using Twitter or Safari.
My test App also switch UIViewController to another UIViewController after I push Notification from the server.

Resources