Reputation: 87
Can anyone guide me on this regarding Pub/Sub and RTDN.
I have an app with in-app subscription, So when users take any subscription my app unlocks some features for them, and meanwhile on the go, I am sending this data to my server.
Now the supposed users have canceled or paused their subscription and my app didn't know about this also there's not enough information available in the queryRecenterPurchases
method.
So here according to google docs. they've provided and want us to use Real-time Developer Notification with Pub/Sub.
So up till now, I managed to understand all this and how it's going to work BUT now i have some questions in my mind and want to know if I am mapping it the right way. Also, can any buddy suggest or recommend to me the best third-party in-app subscription model and will it be safe to use?
e.g: Pusher, Purchasely, Namiml...etc
Or I can do all this without this using. e.g: Firebase Messaging Service (FCM) and OneSignal.
So, at this point, I know how can I sync google in-app purchases with my server BUT how can I notify my app about these changes? My backend is in Laravel. Remember, I don't want notification but some sort of messaging mechanism so whenever the user opens my app gets a notification message from my server or whatever that this user has an opt-out from the subscription.
Upvotes: 0
Views: 1467
Reputation: 1178
<disclaimer> I created Purchasely </disclaimer>
Your architecture schema is perfectly fine. I'd like to add some informations:
https://my-app.com/subscription_cancel
will receive a LOT of different events and not just the cancellation eventsexpiryTimeMillis
, paymentState
and autoRenewing
)So your endpoint is a sensitive thing here and handling subscriptions status is complicated even with just one platform (Google).
Most apps check the subscriber status on app launch or before accessing the paid feature / content. If you want to act in real time, once your have received the notification from the store, analysed the message, you can use Pusher / One Signal / Firebase for real-time alerting.
<promo> If you don’t want to handle that part yourself, don’t hesitate to reach us (we even have a Firebase extension for your app to be notified in real time with 0 backend development).</promo>
Upvotes: 3