Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android/Google+ How to know if user's friends have installed application

I'm trying to retrieve the people in a user's circle that have installed the current application.

I have used the sample application "PlusSampleActivity" provided in the SDK and successfully managed to get the list of all people in the user's circles. However, I'm not sure how to get if the person have installed the application or not. The documentation available seems to be very limited...

What I have found is https://developer.android.com/reference/com/google/android/gms/plus/model/people/Person.html I'm using below function but this is always returning false. (I have created a user that have installed the app and I can see this when visiting the user's profile on the web using Google+)

Is there some other API that should be used? Or some way to debug this better?

public abstract boolean isHasApp ()

If "true", indicates that the person has installed the app that is making the request and has chosen to expose this install state to the caller. A value of "false" indicates that the install state cannot be determined (it is either not installed or the person has chosen to keep this information private).

UPDATED Seems like the hasapp field is not even included in the response? When trying the API on below link, I never succeed to have the hasapp included in the response... Any suggestions what I might be doing wrong?? https://developers.google.com/apis-explorer/#p/plus/v1/plus.people.get

(I posted the same question on Google groups, here)

like image 794
Raz Avatar asked Apr 18 '13 12:04

Raz


1 Answers

Unfortunately, the hasApp field doesn't get filled in the response - it's actually a legacy field from an older API. The best way of matching is to keep track of installed users in your database with their Google IDs, and compare that to the IDs in the people.list response.

The documentation should be updated to reflect this soon, sorry for the confusion!

like image 157
Ian Barber Avatar answered Oct 31 '22 02:10

Ian Barber