简体   繁体   English

远程通知“ application:didFinishLaunchingWithOptions:”方法未调用

[英]Remote Notification 'application:didFinishLaunchingWithOptions:' method not called

Target: 7.0 and UP 目标:7.0及更高版本

Testing on: iPhone6 Device 在以下设备上测试:iPhone6设备

I have been testing Regular Push Notifications (Remote). 我一直在测试常规推送通知(远程)。

I have discovered that if a user clicks on the app icon -- the "applicationDidFinishLaunching:" method is never called. 我发现,如果用户单击应用程序图标,则永远不会调用“ applicationDidFinishLaunching:”方法。

I have been reading and re-reading the guide on "Handling Local and Remote Notifications" and to confirm that I understood everything referred to: Handling Remote Notifications 我一直在阅读和重新阅读有关“处理本地和远程通知”的指南,并确认我了解所指的一切: 处理远程通知

It says If a user taps the default button in the alert or taps (or clicks) the app icon, then the app should call its delegate "application:didFinishLaunchingWithOptions" method. 它说,如果用户点击警报中的默认按钮或点击(或单击)应用程序图标,则该应用程序应调用其委托“ application:didFinishLaunchingWithOptions”方法。 And if its a remote notification, it should call "application:didReceiveRemoteNotification:fetchCompletionHandler:". 如果是远程通知,则应调用“ application:didReceiveRemoteNotification:fetchCompletionHandler:”。

Neither one of these methods get called if I click on the app icon. 如果我单击应用程序图标,则不会调用这些方法之一。

The only method that does get called is applicationWillEnterForeground . 唯一被调用的方法是applicationWillEnterForeground

I do have a storyboard file. 我有一个情节提要文件。 So the way it loads: 因此加载方式:

--> navigation controller --> table view controller --> so on ->导航控制器->表格视图控制器->依此类推

Am I supposed to somehow set the appDelegate in the storyboard file? 我应该以某种方式在情节提要文件中设置appDelegate吗?

I have done a lot of research and so far I have had no luck. 我做了很多研究,到目前为止,我还没有运气。

My push alerts do come through so I know that it works. 我的推送警报确实通过了,所以我知道它是有效的。 I just haven't been able to determine why these other methods are not being called when the user clicks on the app icon. 我只是无法确定为什么用户单击应用程序图标时未调用这些其他方法。

Any suggestions or help is appreciated. 任何建议或帮助表示赞赏。

如果要在用户单击应用程序图标时进行处理,唯一的解决方案是A.)设置静默通知或B.)在服务器上设置某些内容,以便您可以向服务器发出请求以了解是否存在是一个新的更新。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 application:didFinishLaunchingWithOptions:在应用崩溃时被调用的方法 - application:didFinishLaunchingWithOptions: method getting called on app crash application:didFinishLaunchingWithOptions没有被调用 - application:didFinishLaunchingWithOptions is not being called application:didFinishLaunchingWithOptions:在iPad上没有被调用 - application:didFinishLaunchingWithOptions: not getting called on iPad 两次调用远程通知方法 - Remote notification method called twice didFinishLaunchingWithOptions远程通知在应用启动时为空 - didFinishLaunchingWithOptions remote notification empty on App Launch application(_ application: UIApplication, didFinishLaunchingWithOptions) 未在启动时调用 - application(_ application: UIApplication, didFinishLaunchingWithOptions) not called on start up URL方案:application:didFinishLaunchingWithOptions :,未调用handleOpenURL - URL schemes: application:didFinishLaunchingWithOptions:, handleOpenURL not called 在什么情况下调用了application:didFinishLaunchingWithOptions :? - In what case that application:didFinishLaunchingWithOptions: been called? 当应用程序从推送通知打开时,是否调用didFinishLaunchingWithOptions - Is didFinishLaunchingWithOptions called when app opens from push notification application:didFinishLaunchingWithOptions:在创建目标控制器之前触发通知 - application:didFinishLaunchingWithOptions: firing notification before destination controller is created
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM