从推送通知(FCM)获取数据,无需点击通知
Get data from push notification (FCM) without do click in notification
我已经可以在应用程序处于前台或后台时管理来自 FCM 的推送通知,当我单击通知弹出窗口并打开应用程序时 "application didReceiveRemoteNotification" 工作没有问题
我的问题是,如果用户正常打开应用程序(点击图标应用程序而不是点击通知),我不知道如何获取通知推送数据,如果他关闭通知我会丢失数据
检查
UIApplicationLaunchOptionsRemoteNotificationKey
要么
application:didFinishLaunchingWithOptions
如果应用程序处于后台状态 UINotification 调用 application didReceiveRemoteNotification ,如果应用程序处于打开状态 UINotification 调用 application:didFinishLaunchingWithOptions,并且iOS.
中不点击通知就无法获取数据
我已经可以在应用程序处于前台或后台时管理来自 FCM 的推送通知,当我单击通知弹出窗口并打开应用程序时 "application didReceiveRemoteNotification" 工作没有问题
我的问题是,如果用户正常打开应用程序(点击图标应用程序而不是点击通知),我不知道如何获取通知推送数据,如果他关闭通知我会丢失数据
检查
UIApplicationLaunchOptionsRemoteNotificationKey 要么 application:didFinishLaunchingWithOptions
如果应用程序处于后台状态 UINotification 调用 application didReceiveRemoteNotification ,如果应用程序处于打开状态 UINotification 调用 application:didFinishLaunchingWithOptions,并且iOS.
中不点击通知就无法获取数据