iOS subscriptions server_to_server notifications using firebase

狂风中的少年 提交于 2021-02-07 08:33:42

问题


I need to implement server-side logic, to handle changes in apple iOS subscriptions status https://developer.apple.com/documentation/storekit/in-app_purchase/enabling_status_update_notifications

My questions is:

  1. Can I do that with firebase? I.e. can I put some, for example "node.js" code on firebase server, to process messages from apple servers?

  2. When I test firebase db servers with nscurl --ats-diagnostics https://server.com, to check is it compatible with apple ATS (https://developer.apple.com/documentation/security/preventing_insecure_network_connections) it's fail only at TLSv1.3 stuff, is it enough to satisfy apple ats requirements?

Edit 26/11/2020 - Btw I successfully implemented iOS subscriptions with Firebase cloud functions - so Firebase it's a way to go.


回答1:


Yes, this is possible with Firebase. You'll have to use Cloud Functions. I've only used it with the Sandbox environment, but it looks like they satisfy Apple's ATS requirements since all status updates came through as expected.

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

After deploying this to cloud functions you'll have to go in App Store Connect -> My Apps -> your app -> App Store -> App information, and enter the url in "Subscription Status URL", which will be something like https://us-central1-[your-project-id].cloudfunctions.net/iapStatusUpdate.



来源:https://stackoverflow.com/questions/56753164/ios-subscriptions-server-to-server-notifications-using-firebase

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