I have push notifications setup in my app. I have the method:
- (void)application:(UIApplication *)application didReceiveRemoteNotification: (NSDictionary *)userInfo
{
if()
{
//app is in foreground to get here
}
else if()
{
//app is in background and then the notification is clicked, to get here
}
}
I need to differentiate between touches of the notification outside the app, and simply receiving the notification in the app. Any help?
While push notifications target users who aren't currently using the app to (hopefully) bring them back, in-app notifications reach a captive audience of users who are in your app and already engaged. Like push notifications, in-app notifications are, technically speaking, interruptions.
Turn on notifications for Android devicesTap More on the bottom navigation bar and select Settings. Tap Turn on notifications. Tap Notifications. Tap Show notifications.
Push notification vs. text message — what's the difference? Text messages are electronic messages sent between phones while push notifications are brief alerts triggered by an application. Learn when to use each to maximize the reach of your message.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
if ( application.applicationState == UIApplicationStateActive )
// app was already in the foreground
else
// app was just brought from background to foreground
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With