google-plusgoogle-plus-signingoogle-domain-api

Google Domain API for iOS with access token


I am developing an application with Google Domain API which would manage activities. I have some questions:

1) This application is for iOS , however I do not see any reference to Google frameworks/PODs for GoogleClientBuilder. Is iOS not supported?

2) I was able to go through Google Sign in through "GIDSignInButton" and delegate, and get the access token and refresh token.

However the APIs for writing posts in Google Domain

https://www.googleapis.com/plusDomains/v1/people/userId/activities

does not have "access token" parameter in the header, however it requires Scope Authorization. In 'GIDSignInButton', there is no option of specifying scope.

I have already referred to https://developers.google.com/+/domains/ , the JAVA code mentioned is not at all useful.

I would be grateful, if I can get some direction on this.


Solution

  • You can use two-way to authenticate the user through Google and implement any other Google API services.

    1.Using Google API-Objective C client, which is available on GitHub.

    Using this method, You can implement the sign in and its has several sample code like Google +, Blogger API integration.

    2 Using Google Sign-In for iOS, which is framework based implementation.

    In this method, you need to authenticate the user, once the user is authenticated, you can add access token into your each request as a request header.

     curl -i -H "Accept: application/json" -H "Authorization: Bearer {{ACCESS_TOKEN}}" "https://www.googleapis.com/plusDomains/v1/people/me/activities/user"  
    

    Please make sure that you have right permission, during the sign In the process in order to get any data during the API.