如果用户禁用了应用程序的推送,是否可以进行静默远程通知?
Is Silent Remote Notifications possible if user has disabled push for the app?
在我的设置标签栏中:
- 我有一个功能特定的开关,可以根据 API 响应将其关闭或打开。
- 从网站上只有管理员有权打开 ON/OFF。
- 我可以让 /user API 每次在设置点击时调用以检查用户的当前设置,但是有一些缺点,比如如果用户已经在设置,那么它不会更新 UI 并在每次点击设置时调用 api 听起来不是一个完美的解决方案。
我认为更好的解决方案是发送静默推送通知,我可以使用它来进行 API 调用以在需要时更新设置 UI。
但是如果用户禁用了推送通知,我还会收到静默推送吗?处理此类情况的推荐方法是什么?
简答,是
The exciting new opportunity for app developers in iOS 8 is that Apple will now deliver “silent” pushes even if the user has opted out of notifications. Also, “silent push” is no longer just for Newsstand apps. Every app can take advantage of this ability to refresh content in the background, creating the most up-to-date, responsive experience possible, the moment the user opens the app.
虽然...
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.
构建应用程序时请记住这一点。
来源:
https://www.urbanairship.com/blog/watch-list-ios-8-opt-in-changes
此矩阵可能会有所帮助。在左侧,它显示是否将调用“didReceiveRemoteNotification:”方法。其他两列与设置应用程序有关。设置 -> YourApp。如果您的应用程序支持通知和后台应用程序刷新。查看矩阵以检查您的应用程序何时会收到静默推送。
其他答案都不错。但它们不是官方答案。
官方答案在What's New in Notifications WWDC 2015视频中:
Silent notifications are enabled by default. The user does not need to
approve your -- does not give permission to your app to use them, and
you can just start using them without asking the user for permission.
But silent notifications are the mechanism behind background app
refresh. At any point you know that the user can go in settings and
disable them. So you can't depend on them always being available. You
don't know if the user the turn them off, and you are not getting a
notification anymore. This also means that silent notifications are
delivered with the best effort. That means that when the notification
arrives on the user's device, the system is going to make some
choices.
详情请见this image and
在我的设置标签栏中:
- 我有一个功能特定的开关,可以根据 API 响应将其关闭或打开。
- 从网站上只有管理员有权打开 ON/OFF。
- 我可以让 /user API 每次在设置点击时调用以检查用户的当前设置,但是有一些缺点,比如如果用户已经在设置,那么它不会更新 UI 并在每次点击设置时调用 api 听起来不是一个完美的解决方案。
我认为更好的解决方案是发送静默推送通知,我可以使用它来进行 API 调用以在需要时更新设置 UI。
但是如果用户禁用了推送通知,我还会收到静默推送吗?处理此类情况的推荐方法是什么?
简答,是
The exciting new opportunity for app developers in iOS 8 is that Apple will now deliver “silent” pushes even if the user has opted out of notifications. Also, “silent push” is no longer just for Newsstand apps. Every app can take advantage of this ability to refresh content in the background, creating the most up-to-date, responsive experience possible, the moment the user opens the app.
虽然...
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.
构建应用程序时请记住这一点。
来源: https://www.urbanairship.com/blog/watch-list-ios-8-opt-in-changes
此矩阵可能会有所帮助。在左侧,它显示是否将调用“didReceiveRemoteNotification:”方法。其他两列与设置应用程序有关。设置 -> YourApp。如果您的应用程序支持通知和后台应用程序刷新。查看矩阵以检查您的应用程序何时会收到静默推送。
其他答案都不错。但它们不是官方答案。
官方答案在What's New in Notifications WWDC 2015视频中:
Silent notifications are enabled by default. The user does not need to approve your -- does not give permission to your app to use them, and you can just start using them without asking the user for permission. But silent notifications are the mechanism behind background app refresh. At any point you know that the user can go in settings and disable them. So you can't depend on them always being available. You don't know if the user the turn them off, and you are not getting a notification anymore. This also means that silent notifications are delivered with the best effort. That means that when the notification arrives on the user's device, the system is going to make some choices.
详情请见this image and