ios - 应用程序被杀死时调用的推送通知方法
问题描述
我从后台最近的应用程序中删除了该应用程序sent notification then my device gets fcm notification succesfully
,但我想知道收到通知时调用哪个方法。因为在我的应用程序中收到通知时,它必须自动打印收据。如何做到这一点?在这种情况下不调用此方法。
-(void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void(^)(UIBackgroundFetchResult))completionHandler
请建议从后台删除应用程序时哪个方法接收通知有效负载(最近的应用程序)
解决方案
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
推荐阅读
- swift - 在 SwiftUI 视图中实现委托
- python - 使用 Tkinter 中的条目将数据添加到数据库
- php - 来自命令行的 Phar
- node.js - 成功登录后如何修复 isAuthenticated=false 且没有 req.user 数据
- powershell - 如何访问数组中的子对象?
- python - 离线python包安装需要连接吗?
- java - 如何在没有递归的情况下实现归并排序
- javascript - 获取音频集合的持续时间
- javascript - 在 VSCode 中构建自定义智能感知
- r - 将 ifelse() 与 R 和文本删除一起使用:如何处理 NA 值?