Reputation: 1126
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.
Upvotes: 5
Views: 1238
Reputation: 999
Once you have the Pub/Sub notification:
message.data
, parse the JSON, and extract packageName
, subscriptionNotification.subscriptionId
and subscriptionNotification.purchaseToken
. See documentation.purchaseType: 0
.Upvotes: 1