Unable to Send Test Notification From Real-time developer notifications in Google Play Console
O

1

12

I have followed these steps:

  1. Go to Google Cloud Console and create/select a project.
  2. On the header, click to open the menu and select ‘Pub/Sub’, or click https://console.cloud.google.com/cloudpubsub/topic/list
  3. Create/select a topic.
  4. Add the service account [email protected], and grant it the role of Pub/Sub Publisher.
  5. Create a subscription. There are 2 types of subscription:
    • Pull: we need to configure our server to pull for new messages.
    • Push: Similar to ios, the notification is send to the endpoint we configure.
  6. Go to Google Play Console and select your app.
  7. Click on ‘Development tools’, then ‘Service & APIs’.
  8. On Real-time developer notifications type the topic name.
  9. You can send a test notification to test that all is connected.

But When I send test notification I get this error:

An error occurred with the test publish on topic projects/project_id/topics/topic_name. Ensure that the topic is correctly created and configured, and the required permissions are set. Refer to the Real-time Developer Notification's Pub/Sub Guide to learn more.

But

  1. I have given pub/sub publisher permission to my service account.
  2. topic name is correct too.
  3. I am able to send test message from this topic in google developer console and I am receiving that response on my server.

any help is appreciated.

Outspeak answered 1/10, 2020 at 5:45 Comment(8)
When you say you have given pub/sub publisher permission to "my" service account, do you mean the [email protected] service account?Preclude
Can you share the topic name (obfuscated if needed, just to view the format that you used)Euler
@KamalAboul-Hosn yes i have added pub/sub publisher permissions to the service account i created which end with gserviceaccount.comOutspeak
@guillaumeblaquiere topic name format is this only projects/project_id/topics/topic_nameOutspeak
Thanks, it was to be sure. Can you also share the name format of the granted service account?Euler
You shouldn't be using a service account you created. You need to give permission to the existing service account "[email protected]"Preclude
@KamalAboul-Hosn can you tell me how can we get user id of user who has purchased a subscription from the body. We receive sku, notificationType, purchaseToken, subscriptionId in subscription objectOutspeak
@Outspeak since that is a separate issue, it would be best to enter a new question.Preclude
P
27

The step that is typically missed in cases like this is the one to grant the Publisher role to the service account [email protected]. This is not a service account that one creates, but one that already exists. This is the service account that the Google Play infrastructure uses to publish, which is why it must be this specific account that is granted the Publisher role.

Preclude answered 3/10, 2020 at 12:58 Comment(6)
That service account does not exist for me, how do I trigger its creation? PubSub API is enabled on GCP.Colvert
You don't need to create it and it shouldn't exist "for you," so you won't find it listed in your set of service accounts. This is a Google-owned service account that you need to give permission to.Preclude
That was my source of confusion. The account is not listed in IAM nor does it show up in autofill suggestions when trying to grant topic permission to the account. I had to type the full name google-play....account.com, and it was accepted.Colvert
Is that written anywhere in the docs? I am glad I found this topic. For clarity: 1. Open the Google Cloud Platform 2. Navigation Menu -> Big Data -> Pub/Sub 3. On the right side under 'PERMISSIONS', click on 'ADD MEMBER' button 4. Under New Members look for: - [email protected] 5. Under Select a role, - look for 'Publisher', - and select: Pub/Sub Publisher 6. Save (and that's it) Now go back to the Google Play Console, your app -> Monetization setup and test the real-time developer notifications again.Pompey
This service account doesn't exist for me. I can't find it following any of the above directions.Blend
Ok, got it. Per @Colvert I had to paste the full name, [email protected], in. If I typed in a portion of it it doesn't find it. COPY & PASTE IT IN. Balls.Blend

© 2022 - 2024 — McMap. All rights reserved.