On iOS, how can my app get the notification data that it received while the phone was in the background?

前端 未结 4 603
醉梦人生
醉梦人生 2021-01-24 06:52

Is there a way in AppDelegate to get a queue of all the notification data? (Once the user opens the app).

4条回答
  •  既然无缘
    2021-01-24 07:14

    You can check for launchOptions Dictionary, for received Notification, when App resumes on tapping a notification,

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        // Override point for customization after application launch.
      NSLog(@"Launch Options:%@",launchOptions);
    
      return YES;
    }
    

提交回复
热议问题