【问题标题】:Google+ API in iOS, GPPShare recipient settingiOS 中的 Google+ API、GPPShare 收件人设置
【发布时间】:2014-04-15 10:36:01
【问题描述】:

我正在尝试将 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).");
}

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

这是我的两个问题:

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

【问题讨论】:

    标签: ios google-plus


    【解决方案1】:

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

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

    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

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

    【讨论】:

    • 感谢您的提示。出乎意料的是,尽管您提到了我的第一个问题,但使用您的建议给了我第二个问题而不是第一个问题的答案。正如您所写,它似乎无法识别圆圈。
    猜你喜欢
    • 1970-01-01
    • 2013-03-30
    • 1970-01-01
    • 1970-01-01
    • 2017-03-21
    • 1970-01-01
    • 2014-05-24
    • 2011-07-31
    • 2020-03-24
    相关资源
    最近更新 更多