Target: 7.0 and UP
目标:7.0
Testing on: iPhone6 Device
测试:iPhone6设备
I have been testing Regular Push Notifications (Remote).
我一直在测试常规推送通知(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. And if its a remote notification, it should call "application:didReceiveRemoteNotification:fetchCompletionHandler:".
它表示,如果用户在警告或点击(或单击)应用程序图标中点击默认按钮,那么应用程序应该调用它的委托“应用程序:didFinishLaunchingWithOptions”方法。如果它是一个远程通知,它应该调用“应用程序:didReceiveRemoteNotification:fetchCompletionHandler:”。
Neither one of these methods get called if I click on the app icon.
如果我点击app图标,这些方法都不会被调用。
The only method that does get called is applicationWillEnterForeground
.
唯一被调用的方法是applicationwillenter前台。
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.
我的推送提醒确实通过了,所以我知道它有效。我只是无法确定当用户点击app图标时,为什么不调用这些其他方法。
Any suggestions or help is appreciated.
任何建议或帮助都是值得赞赏的。
1 个解决方案
#1
0
The only solution if you want to handle when a user clicks on the app icon is to either A.) set up silent notifications or B.) Set up something on your server so that you can make a request to it to find out if there was a new update.
当用户点击应用程序图标时,唯一的解决方案是a)设置静默通知或b)。在您的服务器上设置一些东西,以便您可以向它发出请求,以查明是否有新的更新。
#1
0
The only solution if you want to handle when a user clicks on the app icon is to either A.) set up silent notifications or B.) Set up something on your server so that you can make a request to it to find out if there was a new update.
当用户点击应用程序图标时,唯一的解决方案是a)设置静默通知或b)。在您的服务器上设置一些东西,以便您可以向它发出请求,以查明是否有新的更新。