Use of silent APNS push notifications to send token without user notification?

心不动则不痛 提交于 2020-01-02 09:12:06

问题


I've checked through other questions and responses here at StackOverflow but couldn't see something exactly like this; I would like to be able to push a token via APNS. The purpose of this is to verify that a subsequent user request to a restful web service comes from an iPhone device and not from a non-iPhone source (it's trivial to change HTTP headers to fake looking like an iPhone request).

Couple of questions:

  1. Is it permissible under Apple Guidelines to insist that push notifications be enabled ?
  2. Is it possible to send a SILENT push notification carrying some small text payload?
  3. Does anyone know if this would pass Apple's scrutiny or run afoul of their guidelines

Many thanks.


回答1:


  1. You cannot force user to accept push. A user always has option to refuse.
  2. Yes you can send a notification with no sound / text, and add metadata.
  3. Yes, sending a token seems an acceptable use for Apple.

However, I do not personally think this use case does cleverly fit the push use case at all. You will have to many edge case to make it reliable enough (delivery delay and non garantee of delivery, etc)

It is easier to have other mechanisms in place (like secret + signature in the URL by the app).




回答2:


I see that folks are still looking at this question. FYI, for enterprise dev which is the area I mostly work in, you simply register the iOS app as a VOIP app and it will accept silent notifications without a need for the user to approve.



来源:https://stackoverflow.com/questions/14427512/use-of-silent-apns-push-notifications-to-send-token-without-user-notification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!