【问题标题】:iOS Google+ get number of friendsiOS Google+ 获取好友数量
【发布时间】:2015-03-19 17:41:11
【问题描述】:

在我的 iOS 应用程序中,我需要检索使用 Google+ SDK 登录的用户的总关注者数量,我使用了此方法,但它返回与我的帐户相关的总人数。我只想计算关注我并且可以看到我在墙上发布的内容的人。 这是我使用的代码:

 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]) {

         }



   }
}];

我该怎么办?

【问题讨论】:

    标签: ios iphone google-api google-plus


    【解决方案1】:

    要获取 Google+ 个人资料的关注者总数,您只需使用 people.get API 方法并使用 circledByCount。请注意,该号码仅在个人资料已公开且基于所有关注者且不能仅限于使用当前应用的个人资料时才可用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-17
      • 1970-01-01
      • 1970-01-01
      • 2012-06-04
      • 1970-01-01
      • 2011-12-08
      • 2011-10-02
      • 1970-01-01
      相关资源
      最近更新 更多