问题
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:
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?
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