简体   繁体   English

从未在应用图标触摸启动中调用didReceiveLocalNotification

[英]didReceiveLocalNotification is never called in app icon touched launch

I can't find any right solution even after long searching. 即使经过长时间搜索,我也找不到任何正确的解决方案。 What is normal scenario in iOS in belows? 下面的iOS中正常情况是什么?

When the app gets local notification, 当应用收到本地通知时,

1) didReceiveLocalNotification is invoked when the app is in foreground. 1)当应用程序处于前台时,将调用didReceiveLocalNotification。 and also is invoked when notification banned touched launch. 并且在通知被禁止触摸启动时也会被调用。

However, under the same situation, 但是,在相同情况下,

2) didReceiveLocalNotification method is not invoked by app icon touched launch. 2)didReceiveLocalNotification方法未由应用图标触摸启动时调用。

Stackoverflow or Apple document said Stackoverflow或Apple文件说

in case of 2), applicationWillEnterForeground -> didReceiveLocalNotification -> applicationDidBecomeActive delegates process is normal. 在2)的情况下,applicationWillEnterForeground-> didReceiveLocalNotification-> applicationDidBecomeActive委托过程正常。 but I've never seen didReceiveLocalNotification in the case of touching app icon. 但我从未见过在触摸应用程序图标的情况下didReceiveLocalNotification。

Please, give me an advice case 2) is normal or not. 请给我一个建议案例2)是否正常。 Help me! 帮我!

Edit - After having couple of comments, I've found a link such as Handling local notifications when the user presses the icon instead of the alert This approach would be working I believe. 编辑-在进行了几次评论后,我发现了一个链接,例如当用户按下图标而不是警报时处理本地通知 。我相信这种方法行之有效。 Thanks. 谢谢。

Edit2 - Local Notification This link would be helpful as well. Edit2- 本地通知此链接也将很有帮助。

That method is only called when your app is launched as a result of interacting with a local notification. 仅当与本地通知进行交互而启动您的应用程序时,才调用该方法。 Not seeing it called during a normal app launch is expected behaviour. 正常的应用启动过程中没有看到它被调用的行为。

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

相关问题 didReceivelocalNotification永远不会被调用 - didReceivelocalNotification is never called application:didReceiveLocalNotification从未在ios 8上调用过 - application:didReceiveLocalNotification never called on ios 8 didReceiveLocalNotification始终在应用启动时触发 - didReceiveLocalNotification always fires on app launch application:didReceiveLocalNotification:在后台app时不调用 - application:didReceiveLocalNotification: not called when app in background 当iOS 7上的应用程序在后台运行时,didReceiveLocalNotification没有被调用 - didReceiveLocalNotification not getting called when app is in the background on iOS 7 当app在后台时,appReceiveLocalNotification方法未在app委托中调用[iOS6] - didReceiveLocalNotification method not called in app delegate when app is in background [iOS6] application:didReceiveLocalNotification:未调用 - application:didReceiveLocalNotification: not called didReceiveLocalNotification,didReceiveRemoteNotification 和 willPresentNotification 在通知出现时从未触发,React Native App - didReceiveLocalNotification, didReceiveRemoteNotification and willPresentNotification never triggered when notifications show up, React Native App didReceiveLocalNotification 在调用 presentLocalNotificationNow 时触发 - didReceiveLocalNotification triggered when presentLocalNotificationNow is called 没有启动图标的iOS App - iOS App without launch icon
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM