Handling Push Notifications when App is NOT running

后端 未结 8 2157
感动是毒
感动是毒 2020-11-29 16:57

When my App is not running and receives a Push Notification, if I click on that notification, the App is launched - but then it doesn\'t prompt the

8条回答
  •  既然无缘
    2020-11-29 17:31

    Better be if you override didReceiveRemoteNotification Here you go

    NSDictionary * pushNotificationPayload = [launchOptions valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
    if(pushNotificationPayload) {
        [self application:application didReceiveRemoteNotification:pushNotificationPayload];
    }
    

    This will again fire the didReceiveRemoteNotification method and your push notification code will execute as same as it runs during application run time.

提交回复
热议问题