在"我的设置"选项卡栏中:
- 我有一个功能特定的switch ,可以根据API响应关闭或打开.
- 从网站上,只有管理员有权打开/关闭.
- 我可以在每次点击设置时调用/user API来判断用户的当前设置,但有两个缺点,比如如果用户已经在设置,那么它将不会更新UI,每次点击设置时调用API听起来不是一个完美的解决方案.
我认为更好的解决方案是发送一个静默推送通知,我可以使用它在需要时调用API来更新设置UI.
但如果用户禁用了推送通知,我还会收到静默推送吗?处理此类情况的建议方法是什么?
在"我的设置"选项卡栏中:
我认为更好的解决方案是发送一个静默推送通知,我可以使用它在需要时调用API来更新设置UI.
但如果用户禁用了推送通知,我还会收到静默推送吗?处理此类情况的建议方法是什么?
简单回答,yes
对于iOS 8中的应用开发者来说,一个令人兴奋的新机会是,即使用户 Select 退出通知,苹果现在也将提供"silent"推送.此外,"silent推送"不再只适用于报摊应用程序.每个应用程序都可以利用这一功能在后台刷新内容,在用户打开应用程序的那一刻创造出最新、最快速的体验.
虽然
Users still have the ability to switch off your app’s ability to process a “silent push” by means of the “Background App Refresh” control. Even though Apple Push Notification service (APNs) will deliver a push marked “content-available” to your phone, the OS will not wake up your app to receive it, effectively dropping it on the floor. However, opting out of “Background App Refresh” is a lesser-known capability not directly associated with Notifications. You don’t access this preference in your Notifications Settings--it’s located under General > Background App Refresh screen.
在构建应用程序时,请记住这一点.
资料来源: