ios - iOS 中的 Google+ API,GPPShare 收件人设置

标签 ios google-plus

我正在尝试将 GooglePlus 集成到我的 iOS 应用程序中。 该应用程序发送一条简单的消息。我对收件人的设置有一些疑问。 这是我正在使用的代码:

[GPPShare sharedInstance].delegate = self;
id<GPPNativeShareBuilder> shareBuilder = [[GPPShare sharedInstance] nativeShareDialog];

[shareBuilder setPrefillText:@"Hello world! How is everything?"];
[shareBuilder setPreselectedPeopleIDs:@"112233445566778899000"]; // Question point!!

if (![shareBuilder open]) {
    NSLog(@"Status: Error (shareBuilder cannot open).");
}

当该行带有注释“问题点!!”时如果存在,我可以将一个(或几个)个人设置为消息的收件人。 如果不存在,则收件人组默认为“ friend ”。

这是我的两个问题:

  1. 是否可以将我的某个圈子(或社区)设置为收件人?不仅是“ friend ”。
  2. 使用“setPreselectedPeopleIDs:”方法时,需要收件人的 ID。我们如何找到这个ID?网上有文档和视频介绍如何查找自己的 ID,但由于人们通常将消息发送给其他人而不是自己,因此了解如何获取其他人的 ID 也很有用。

最佳答案

您似乎无法与特定圈子分享。

您可以使用此方法获取用户圈子中使用此方法的所有可见人

queryForPeopleListWithUserId:collection:

此处概述:

https://developers.google.com/+/mobile/ios/people

标题中参数的解释:

// List all of the people in the specified collection.
//  Required:
//   userId: Get the collection of people for the person identified. Use "me" to
//     indicate the authenticated user.
//   collection: The collection of people to list.
//      kGTLPlusCollectionVisible: The list of people who this user has added to
//        one or more circles, limited to the circles visible to the requesting
//        application.

还有另一个问题:

How to Fetch Google Plus circles in IOS Sdk

不幸的是,在我看来你无法辨别谁在哪个圈子里。

关于ios - iOS 中的 Google+ API,GPPShare 收件人设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23073621/

相关文章:

ios - 如何在 Skobbler 中填充 SKRouteSettings.alternativeRoutesModes 数组

ios - 在多个线程上访问 ViewContext 导致崩溃

php - 当用户使用 Google Oauth2 和 people.me 进行身份验证时如何获取电子邮件地址

ios - 为什么在 iOS 中禁用了 Google+ 登录页面的接受按钮?

javascript - 如何为google+和twitter的 "like button"分配动态链接

ios - 此自定义 View 不调用数据源的方法

ios - 最小化窗口动画,但对于 iOS?

android - 当我从其他计算机上的存储库克隆项目时 Ionic2 出错

java - Android 中 Activity 的 +1 按钮始终呈灰色

ios - 为什么这里需要类型转换?