iPhone 充当 APNs 的提供者(没有第三方服务器的 Apple 推送通知)

iPhone act as Provider to APNs (Apple Push Notifications without third party server)

所以我的客户想要一个像这样工作的应用程序:

所以我一直在研究 Apple Push Notification Service 但我不想拥有第三方 "provider" 服务器。 iPhone 可以充当 "provider" 吗?

我已经看过 this question 这听起来像是我想做的,但我对答案不满意。更具体地说:

Would encrypting the APNs key with another key hardcoded into the app be secure enough?

我认为主要问题是您需要随应用一起提供 APNS 证书和私钥,并在需要时(在所有设备上)续订。无论它是否加密,如果它可用于您的应用程序,它就可能可供攻击者使用(通过从内存中转储其明文表示形式,或通过反汇编您的解密代码)并使冒充您的应用程序成为可能。所以不,它不安全。

The tokens will always stay the same for a given app for a given device, right?

不是真的。文档声称 设备令牌不是可用于识别设备的唯一 ID。更新设备上的操作系统后,设备令牌可能会更改。因此,应用程序应发送其设备令牌

Will Apple accept such an app?

以上原因相信没有先例