我正在尝试将 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 ”。
这是我的两个问题:
- 是否可以将我的某个圈子(或社区)设置为收件人?不仅是“ friend ”。
- 使用“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/