Reputation: 11
I'm trying to build a Google Hangout App as a game, but I'm unsure with the current Google Hangout API how to target a specific user. So for instance, if I want a specific participant to be the only person that can see a div in the app, how would I go about limiting based on a specific user ID?
Upvotes: 1
Views: 999
Reputation: 50701
You can get the Participant of the current user by using gapi.hangout.getParticipantById( gapi.hangout.getParticipantId() ) (See https://developers.google.com/+/hangouts/api/gapi.hangout#gapi.hangout.getParticipantById for more details).
The Google ID is stored in the Participant object in the person.id field (see https://developers.google.com/+/hangouts/api/gapi.hangout#gapi.hangout.Participant for details about the Participant object).
So once you have the Participant for the current user, you can check the person.id field to see if it matches the person in question. There are other fields that may be more suitable for your exact needs, however, so I encourage you to look over and experiment with different fields and methods.
Upvotes: 1