iOS 订阅 server_to_server 使用 Firebase 的通知

iOS subscriptions server_to_server notifications using firebase

我需要实现服务器端逻辑,以处理 apple iOS 订阅状态​​的变化 https://developer.apple.com/documentation/storekit/in-app_purchase/enabling_status_update_notifications

我的问题是:

  1. 我可以用 firebase 做到这一点吗? IE。我可以在 firebase 服务器上放置一些代码,例如“node.js”代码来处理来自苹果服务器的消息吗?

  2. 当我用 nscurl --ats-diagnostics https://server.com 测试 firebase 数据库服务器时,检查它是否与 apple ATS (https://developer.apple.com/documentation/security/preventing_insecure_network_connections) 兼容,它仅在 TLSv1.3 方面失败,是否足够满足 Apple ATS 要求?

编辑 2020 年 11 月 26 日 - 顺便说一句,我成功地实施了 iOS 带有 Firebase 云功能的订阅 - 所以 Firebase 这是一个可行的方法。

是的,这可以通过 Firebase 实现。您必须使用云功能。我只在 Sandbox 环境中使用过它,但看起来它们满足 Apple 的 ATS 要求,因为所有状态更新都按预期进行了。

exports.iapStatusUpdate = functions.https.onRequest((req, res) => {
  //all receipt info will be in req.body
})

将此部署到云功能后,您必须进入 App Store Connect -> 我的应用程序 -> 您的应用程序 -> App Store -> 应用程序信息,然后在 [=16] 中输入 url =],类似于 https://us-central1-[your-project-id].cloudfunctions.net/iapStatusUpdate