Pregunta

I am trying to integrate GooglePlus inside an iOS app of mine. The app sends a simple message. I have a few questions about the setting of the recipient(s). Here is the kind of code I am using:

[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).");
}

When the line with the comment "Question point!!" is present, I can set one(or a few) individual(s) as recipient(s) of the message. When it is not present the set of recipients defaults to "Friends".

Here are my two questions:

  1. Is it possible to set one of my circles (or a community) as recipient? Not only "Friends".
  2. When using the "setPreselectedPeopleIDs:" method, one needs the ID of the recipient. How do we find this ID? There are documents and videos on the net showing how to find one's own ID, but since people usually send messages to other peole rather than to themselves, it would also be useful to know how to get other's IDs.
¿Fue útil?

Solución

Doesn't seem like you can share with a specific circle.

You can use this method to get all of the visible people in the user's circles using this method

queryForPeopleListWithUserId:collection:

which is outlined here:

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

Explanation of the parameters from the header:

// 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.

And another question that goes into this a little bit:

How to Fetch Google Plus circles in IOS Sdk

It does not seem to me like you can discern who is in what circle, unfortunately.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top