Search code examples
objective-cgoogle-apioauth-2.0google-tasks-api

iOS Objective C Authorisation issue when Google OAuth 2.0


I am currently working with Google API with Objective C and OAuth 2.0 api is giving me a headache whole day

I have been looking at google's documentation

And I have managed to get to a stage where I can login and 'Allow Access'

The issue arises the following step.

From API, I get Authentication Token. and according to the documentation I'm following ( link above)

I can authorise the request with method

[auth authorizeRequest:myNSURLMutableRequest
          delegate:self
 didFinishSelector:@selector(authentication:request:finishedWithError:)];

then I have no idea what 'myNSURLMutableRequest' is.

Any advice so much appreciated

By the way I am going to work with Google Task API


Solution

  • You can use a existing library to use a service with OAuth protocol. You don't have to reinvent the wheel !

    https://github.com/leebyron/cocoa-oauth2

    https://github.com/lukeredpath/LROAuth2Client