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.
Inside your project in the Firebase console, select the gear icon, select Project Settings, and then select the Cloud Messaging tab. In APNs authentication key under iOS app configuration , click the Upload button.
Make sure you also select Push Notifications in the service check box. Head back to your Firebase panel and, under Project Settings, select the Cloud Messaging tab. Under APNs Authentication Key within the iOS app configuration, click the Upload button. Now upload the APNs auth key you downloaded from the Apple Developer Portal.
In APNs authentication key under iOS app configuration, click the Upload button. Browse to the location where you saved your key, select it, and click Open. Add the key ID for the key (available in the Apple Developer Member Center) and click Upload. Initialize Firebase in your app
If you don't already have an APNs authentication key, see Configuring APNs with FCM. Inside your project in the Firebase console, select the gear icon, select Project Settings, and then select the Cloud Messaging tab. In APNs authentication key under iOS app configuration, click the Upload button.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With