首页 > 解决方案 > 应用程序被杀死时调用的推送通知方法

问题描述

我从后台最近的应用程序中删除了该应用程序sent notification then my device gets fcm notification succesfully,但我想知道收到通知时调用哪个方法。因为在我的应用程序中收到通知时,它必须自动打印收据。如何做到这一点?在这种情况下不调用此方法。

-(void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void(^)(UIBackgroundFetchResult))completionHandler

请建议从后台删除应用程序时哪个方法接收通知有效负载(最近的应用程序)

标签: iosobjective-cswiftxcodefirebase-cloud-messaging

解决方案


There is no way to receive remote notification handlers for notifications if the app has been force-quit.

"However, the system does not automatically launch your app if the user has force-quit it. In that situation, the user must relaunch your app or restart the device before the system attempts to launch your app automatically again."

https://developer.apple.com/forums/thread/65817

https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application


推荐阅读