-1

I created one project and did all the steps required for push notification creating topic,subs and all but when I call watch method will it work for who I have created the project or for any user who i give in watch method

AJinkya
  • 21
  • 8

1 Answers1

0

The user the access token you are using corresponds to when calling the watch-method, is the one you will get push notifications for.

Tholle
  • 108,070
  • 19
  • 198
  • 189
  • Do I need to purchase the service account for doing all this ? – AJinkya Feb 19 '16 at 07:27
  • @TestAccount No, a [regular account works](https://developers.google.com/gmail/api/auth/about-auth). Broadly speaking, you redirect users that come to your site to Google with you `client id` and `client secret`, and if they give permission at Google, you will get a code. This code can then be exchanged to an `access token` you use in your requests. – Tholle Feb 19 '16 at 07:31
  • OK thats true we will get a token,But when I am creating a subscription we need to give end points but when i try to set the end points it does not set for regular accounts @tholle – AJinkya Feb 19 '16 at 07:33
  • @TestAccount I don't have the time for that, sorry. Set up a single route and a single topic that will work for all your users. Then, you will have to watch for each individual user with their corresponding `access token`. – Tholle Feb 19 '16 at 07:37
  • should i create it with regular web client account or with service account ? @tholle – AJinkya Feb 19 '16 at 07:38
  • single route means single subscription is that true @tholle – AJinkya Feb 19 '16 at 07:51