Managing Google Subscriptions Part 2

In this topic, you will learn how to configure Google subscriptions' publisher/subscriber data exchange. This is the second part of the larger process of establishing communication between your Brightcove Beacon apps and the Google Store.

Introduction

This document steps you through using the Google Cloud Platform to create a Pub/Sub topic and add a previously created service account to the Pub/Sub topic.

Create a Pub/Sub topic

Perform the following steps to create a Pub/Sub topic:

  1. Browse to the index page for Google Cloud platform (https://cloud.google.com).
  2. Click the Console link in the top-right of the screen.
    click console
  3. Choose the correct project. You most likely have named your project around your app, like Beacon.
    choose project
  4. In the Search, enter pub, and once it appears, click Pub/Sub.
    search for pub/sub
  5. From the Pub/Sub page, click CREATE TOPIC.
    click create topic
  6. In the Create a topic dialog, enter the Topic ID to be subs, then click CREATE TOPIC.
    sub for topic ID
  7. On the page that appears, click ← to return to the the Topics page.
    back to topics

Add a member to the topic

Perform the following steps to add a service account as a member of the Pub/Sub topic:

  1. From the Topics page, for the subs topic, click More actions (the three vertical dots) then from the dropdown select View permissions.
    view permissions
  2. From the permission panel, click ADD MEMBER.
    click add member
  3. Confirm you are seeing the following form:
    add member form
  4. To get the required email address, browse to the Google Cloud Console - Service Accounts page. You will find the service account you created in the Managing Google Subscriptions Part 1 document. Copy the email address for the Android Subscriptions (or the name you chose) service account.
  5. Return to the Add members form in Google Cloud Platform.
  6. Paste the retrieved email address into the New members text field.
  7. For the role, select Pub/Sub → Pub/Sub Publisher.
  8. Click the Send notification email checkbox, and add a message.
  9. Confirm your form is filled in similar to the following:
    filled in form
  10. Click Save.
  11. Next, you will add another member email. This will help ensure that google play notifications are received

    From the permission panel, click ADD MEMBER.
    click add member
  12. Confirm you are seeing the following form:
    add member form
  13. Add the the following member email:
    google-play-developer-notifications@system.gserviceaccount.com
  14. Set the role to Pub/Sub Editor.
    add member2 form
  15. Next, select Subscriptions.
    Select Subscriptions
  16. Select Create Subscription.
    Create Subscription
  17. Enter a Subscription ID value of subs. From the Select a Cloud Pub/Sub topic dropdown, select a topic.
    Subscription ID and topic
  18. Click Create.
  19. From the Topics page, click the subs topic.
    click subs
  20. From the Topic details, copy the Topic name (note there is built in copy button, outlined in red).
    copy topic name
  21. Send this name to your onboarding manager.

Verify your setup

Follow these steps to verify the notifications for your publisher/subscriber data exchange.

  1. In the browser, navigate to the Google Play console (https://play.google.com/console/).
  2. Search for pubs.
    Search for pubs
  3. Select Monetization.
  4. Choose your app.
    Choose your app
  5. Enter the topic.
    Enter the topic
  6. Select Send test notification.
  7. If your setup is correct, you should see the following. Note that it takes some time to propagate configurations on Google cloud.
    Test notification msg