应用程序关闭时的本地通知处理
我有一个与处理通知相关的问题,但如果申请已关闭。在我的 iOS 应用程序中,我安排了本地通知,并且当应用程序位于前台或后台时我成功处理了它们。但是当应用程序关闭并且我收到本地通知时我无法处理它。我的意思是按“显示”按钮后我必须将用户移动到特定窗口。但我不知道将处理处理的代码部分放在哪里。 有什么想法吗??? 提前致谢。
阿尔门
I have a question related to handling notifications but in case of application is closed. In my iOS application I schedule the local notifications, and I successfully handle them when application is either in foreground or background. But when application is closed and I get local notification I can't handle it. I mean after pressing "show" button I have to move the user to a specific window. But I don't know where to put the part of the code which deals with handling.
Any idea???
Thanks in advance.
Armen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
检查应用程序委托中的
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
,据我所知,您应该从通知中接收字典作为启动选项。试试这个
Check
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
in your app delegate, you should receive dictionary from your notification as launching options, as far as I know.Try this
我可以发布一些代码,但我认为更好的方法是不进行复制/粘贴工作。因此,这是他们显示单个通知后的链接,他们解释了如何处理通知。关于处理通知的教程
I could post some code hear but i think the better way is no copy/paste work. So here is the link after they show single notification, they explain how to handle notifications. tutorial about handling notifications