When a subscription notification from an inapp product (using real-time PUB/SUB) reach our server, how can we know if that notification came from a test purchase? In the Google documentation said that the PUB/SUB test notifications have an attribute as testNotification but this attribute only shows when the notification was created in the Cloud Platform, but this attribute doesn't appear when the notification was a subscription notification.
Once you have the Pub/Sub notification:
message.data
, parse the JSON, and extract packageName
, subscriptionNotification.subscriptionId
and subscriptionNotification.purchaseToken
. See documentation.purchaseType: 0
.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