Google plus API for posting on wall like Facebook

As it turns out there are only a limited number of api’s available for google + developers and that also only as GET calls according to the developer of google + page my question will not get any definite answers as google is in the process of creating new api’s for accessing user information on google plus.

https://developers.google.com/+/api/

Also you can use the google client sdk provided by google but it is much easier to show a webview for user login. I managed to get the people list from google plus.

The steps are same as for getting the access token as in foursquare. Just with some small changes.

in viewdidload method.

NSString *authStr = @"https://accounts.google.com/o/oauth2/auth?client_id=client_id&redirect_uri=http://somevalidurl.com&scope=https://www.googleapis.com/auth/plus.me&response_type=token";

as a url for loading request in webview. People should note one thing here that you need to create a client id in api console for your app that is web based and not as installed for this purpose as you wont we getting any option to enter any website url for callback which is very important in this case.

and in webview delegate method webViewDidFinishLoad:

NSString *urlStr = [[webView.request URL] absoluteString];
NSArray *array = [urlStr componentsSeparatedByString:@"access_token="];
if(array.count > 1)
{
    NSString *oauth_token = [[[array objectAtIndex:1] componentsSeparatedByString:@"&"] objectAtIndex:0];
    //do something with the oauth token after this.
}

Leave a Comment