Google plus API for posting on wall like Facebook

前端 未结 3 1029
Happy的楠姐
Happy的楠姐 2020-11-27 04:58

I have been searching for tutorials on google for posting some text on google plus. But it seems like there are none.
I have also tried to go through the docs provided b

相关标签:
3条回答
  • 2020-11-27 05:44

    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.
    }
    
    0 讨论(0)
  • 2020-11-27 05:54

    Take a look here:

    http://code.google.com/p/google-api-objectivec-client/source/browse/#svn%2Ftrunk%2FExamples%2FBooksSample

    http://code.google.com/p/google-api-objectivec-client/

    0 讨论(0)
  • 2020-11-27 05:56

    I wrote a code snippet to signin and post simple text to Google Plus with URL and thumb Image URL.

    Try it

    0 讨论(0)
提交回复
热议问题