确定是否允许本地通知 [英] Determine if local notification is allowed

查看:39
本文介绍了确定是否允许本地通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检测本地(非推送通知)通知是否允许?我打算将本地通知与我的应用程序集成,对于应用程序功能来说,检测是否允许本地通知非常重要.

How to detect local(not push notification) notifications are allowed or not ? I'm going to integrate local notifications with my app, and for app functionality is very important to detect are local notifications allowed or not.

推荐答案

本地通知始终是允许的,并且与 iOS SDK 中的任何其他功能一样可用.但是,推送通知需要特殊签名才能使应用程序工作.在开发者文档中阅读更多相关信息.

Local notifications are always allowed and are available as any other functionality in iOS SDK. Push notifications, however, require special signature for the app to work. Read more about that in Developer docs.

如果你的应用在最前面并且需要响应本地通知,只需实现方法application:didReceiveLocalNotification:如果不是,则实现 Apple Developer 文档中方法 application:didFinishLaunchingWithOptions:

If your app is frontmost and requires to respond to local notification, just implement method application:didReceiveLocalNotification: If it's not, then implement functionality, that is described in Apple Developer docs in method application:didFinishLaunchingWithOptions:

这篇关于确定是否允许本地通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆