0

While using Unity 2020.3.9f1 and Unity IAP 3.2.1 I can send the initial subscription via a regular https request to my Spring backend and receive the user information from backend auth + purchase token via the request. I can then insert the expiry date (which I query from Google API using AndroidPublisher and the token) to my database and give premium features to the given user for that time period.

When the subscription is about to renew, I need to update the users premium feature expiry date in the database accordingly.

I already found out, that I can receive this renewal information, even if the client is not active, via Google Cloud Pub/Sub by linking it with the apps monetization. The backend then receives a purchase token, but this time there is no more user information since the request was not issued through a client/server request.

I also figured out that there is/was a developer payload to use for that purpose. My question is how I can add this to the subscription to link renewal subscription notifications to a certain user on receiving renewal subscription notifications. I do not really want to add a new index on a (at least in test mode always unique) purchase token to my database if I do not have to.

I use Firebase Auth in my app - can I make use of that in any way?

Codehai
  • 524
  • 1
  • 7
  • 27
  • Regarding https://stackoverflow.com/questions/56130192/how-to-identify-user-when-server-receive-subscription-state-change-notification storing the purchase token seems to be the only way to solve this riddle? – Codehai May 25 '21 at 19:53
  • Maybe using a google play billing extension https://developer.android.com/google/play/billing/unity is a solution which allows using SetObfuscatedAccountId() as an alternative to the obsolete developer payload. Still having problems to integrate the plugin however so I can't confirm this fix to work for now.. – Codehai May 25 '21 at 22:11

0 Answers0