问题描述
我刚刚对这里返回的结果进行了一些测试
I've just ran some tests here on the result returned by
-(UIRemoteNotificationType)enabledRemoteNotificationTypes
我在 applicationDidBecomeActive
委托方法中调用它并登录结果。
设置警报,徽章或声音时工作正常。
I'm calling it in the applicationDidBecomeActive
delegate method and Loging the result.It works fine when alerts, badges or sounds are set.
然而,当我的app推送设置中只设置了在锁定屏幕中查看设置时, enabledRemoteNotificationTypes
仍然返回 UIRemoteNotificationTypeNone
。
However, when only the "View in Lock Screen" setting is set in my app push settings, the enabledRemoteNotificationTypes
still return UIRemoteNotificationTypeNone
.
是的我得到声音,徽章和警报在设置中被禁用,但我们有没有办法在应用程序中检测这种情况?
Yes I get that sound, badge and alerts are disabled in the settings but shoudn't we have some way to detect this scenario in the App ?
换句话说:如何知道用户只为应用程序设置了在锁定屏幕中查看设置?
In other words : How to know that the user only set the "View in Lock Screen" setting for the app ?
推荐答案
你不能。 API仅提供有关声音,徽章和警报的信息。
You can't. The API only provides information about sounds, badges, and alerts.
这篇关于在锁定屏幕和enabledRemoteNotificationTypes中查看 - iOS5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!