Hi everyone!
I’m currently implementing IAP’s for our game. I’ve got Google IAP’s working perfectly with additional logic running in “RegisterAfterValidatePurchaseGoogle”.
Now I’m trying to do the same with subscriptions but dealing with a few road blocks.
Issue 1: I don’t seem to have an equivalent to “RegisterAfterValidatePurchaseGoogle” but for subscriptions. I.E.: RegisterAfterValidateSubscriptionGoogle. As such how would I be able to know the user just subscribed?
Issue 2: What value should we use for iap.google.notifications_endpoint_id?
I’m pretty confident we have the setup from google play done correctly as I can see the messages when pressing pull in the Google Cloud Pub/Sub webpage.
The subscription name given by google has the following format (I anonimized these values):
projects/myapp-85069681/subscriptions/MASubs-sub
The value provided in the Nakama documentation is as follows:
/v2/console/google/subscriptions/<notifications_endpoint_id>
I see no overlap in either of these and end up having no idea what to use as notifications_endpoint_id.
Should it be:
/v2/console/google/subscriptions/projects/myapp-85069681/subscriptions/MASubs-sub
or
/v2/console/google/subscriptions/MASubs-sub
I tried both but had no success in having nakama identify the renewal of a subscription.
I’ve even added the iap.google.package_name and set the iap.google.refund_check_period_min to 1 in the config.yml but that doesn’t seem to fix anything either.
I’d really appreciate some help/guidance. We’re using Golang for the backend logic in Nakama 3.14.0 as we had to downgrade from 3.15.0 due to this bug.
To clarify, here is an anonimized version of the relevant part my current config.yml:
apple:
shared_password: ''
notifications_endpoint_id: ''
google:
client_email: 'myappnakamabackend@api-2137238579647032880-116300.iam.gserviceaccount.com'
private_key: "-----BEGIN PRIVATE KEY-----\nA_REALLY_LONG_AND_SECRET_KEY=\n-----END PRIVATE KEY-----\n"
notifications_endpoint_id: 'MASubs-sub'
package_name: 'com.company.myapp'
refund_check_period_min: 1