How to use Google idToken, accessToken from my hosted server into my app?

457 Views Asked by At

Forgive me for my English!

I am using google Rest API client and GIDSignIn to sign in google account for my app.

     GIDSignIn.sharedInstance().delegate = self
            GIDSignIn.sharedInstance().uiDelegate = self
            GIDSignIn.sharedInstance().scopes = scopes
            GIDSignIn.sharedInstance().signIn()

  func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!,
              withError error: Error!) {
        if let error = error {
            showAlert(title: "Authentication Error", message: error.localizedDescription)
            self.service.authorizer = nil
        } else {

            self.service.authorizer = user.authentication.fetcherAuthorizer()
           print("Successs")
        }
    }

Successfully signed in after using this.

But I want to use idToken and accessToken into my app getting from my hosted server.

By using those token I want to fetch google calendar events.

Please help how can I use tokens which are getting from my hosted server into my iOS app.

Thanks.

0

There are 0 best solutions below