Search code examples
iosoauthoauth2client

oAuth2Client how do you pass the token on to the library


I guess I'm just missing something here.

I'm trying to setup https://github.com/nxtbgthng/OAuth2Client with my App.

I don't understand how I have to pass the oauth token to the library.

I call:

[[NXOAuth2AccountStore sharedStore] requestAccessToAccountWithType:@"myFancyService"];

I then successfully get a token in:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;

How do I pass the token on to the library?!


Solution

  • turns out one has to call:

     [[NXOAuth2AccountStore sharedStore] handleRedirectURL:url];
    

    in:

    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;