开发者

Can LocalNotifications be disabled by the user

I want to use UILocalNotifications as a background timer for an app. C开发者_Python百科an this notifications be disabled by the user like remote notifications? If the user disables remote notifications for the app, are the local notifications disabled to?


I finally wrote a test app to test this feature. The settings of "Notification" has no effect on local notifications. They will appear also while "Notifications" are completely disabled.


If you look closely at that page of Settings.app, you'll see it's called "Notification". No mention of local/remote. The two kinds of notification are actually designed to be indistinguishable to the user. So your settings in the Settings.app affect both types.

That said, I also think it's polite to give people the option of disabling them in my app itself. If a person opts out in the settings screen of my app, I either cancel all upcoming local notifications, or hit my server with some flag turning off remote notifications for this user. I also store that preference in NSUserDefaults so it can inform my notification-scheduling and apn-token-registering behavior on next launch.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜