Push Notification issue with OneSignal

461 views Asked by At

Please see below image

I am using oneSignal for push notification, Now days what is happening whenever app is running in background and user is tapping on the notification. App delegate function didFinishLaunching method is not getting called?

1

There are 1 answers

1
Fahim Parkar On

If app is open and you click on push, didFinishLaunching will never get called... at this time didReceiveRemoteNotification will get called, so implement below.

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
    NSLog(@"userInfo===%@", userInfo);
    NSDictionary *apsInfo = [userInfo objectForKey:@"aps"];
    // do here with the push
}