Handling Push Notifications when App is NOT running

后端 未结 8 2184
感动是毒
感动是毒 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:25

    I tried @dianz's answer, It's not worked for me but I got a help from the answer.

    In my case;

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    NSDictionary *apnsBody = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
    if (apnsBody) {
        // Do your code with apnsBody
    }
    

提交回复
热议问题