user31929
user31929

Reputation: 1145

iOS Google+ get number of friends

In my iOS app I need to retrieve the total follower numbers of the user that is logged in with Google+ SDK, I have used this method but it returns the total number of people that related to my account. I wanna count only the person who follow me and can see what I publish in my wall. this is the code i have used:

 GTLQueryPlus *query =
[GTLQueryPlus queryForPeopleListWithUserId:@"me"
collection:kGTLPlusCollectionVisible];

// 2. Execute the query.
[[[GPPSignIn sharedInstance] plusService] executeQuery:query
      completionHandler:^(GTLServiceTicket *ticket,
      GTLPlusPeopleFeed *peopleFeed,
NSError *error) {
   if (error) {
      GTMLoggerError(@"Error: %@", error);


   } else {


      // Render the status of the Google+ request.
      NSNumber *count = peopleFeed.totalItems;
      Total=[count intValue];
      id<GPPShareBuilder> shareBuilder = [self shareBuilder];

         if (![shareBuilder open]) {

         }



   }
}];

How i can do?

Upvotes: 0

Views: 233

Answers (1)

abraham
abraham

Reputation: 47893

To get the total number of followers a Google+ profile has you simply need to use the people.get API method and use the circledByCount. Note that that number is only available if the profile has made it public and it is based on all followers and can not be limited to profiles using the current app.

Upvotes: 1

Related Questions