문제

I have used GTMOAuth to successfully login to dropbox but i dont seem to be able to get the delegate to callback once the response is returned I have this code to login ..

NSURL *requestURL = [NSURL URLWithString:@"https://api.dropbox.com/1/oauth/request_token"];
NSURL *accessURL = [NSURL URLWithString:@"https://api.dropbox.com/1/oauth/access_token"];
NSURL *authorizeURL = [NSURL URLWithString:@"https://www.dropbox.com/1/oauth/authorize"];
NSString *scope = nil;

GTMOAuthAuthentication *auth = [self authForTwitter];
if (auth == nil) {
// perhaps display something friendlier in the UI?
 NSAssert(NO, @"A valid consumer key and consumer secret are required for signing in to Twitter");
}

// set the callback URL to which the site should redirect, and for which
// the OAuth controller should look to determine when sign-in has
// finished or been canceled
//
// This URL does not need to be for an actual web page; it will not be
// loaded
[auth setCallback:@"https://www.dropbox.com"];

NSString *keychainItemName = nil;
if ([self shouldSaveInKeychain]) {
  keychainItemName = kTwitterKeychainItemName;
}

// Display the autentication view.
GTMOAuthViewControllerTouch *viewController;
viewController = [[[GTMOAuthViewControllerTouch alloc] initWithScope:scope
             language:nil
      requestTokenURL:requestURL
     authorizeTokenURL:authorizeURL
       accessTokenURL:accessURL
       authentication:auth
       appServiceName:keychainItemName
             delegate:self
     finishedSelector:@selector(viewController:finishedWithAuth:error:)] autorelease];

// We can set a URL for deleting the cookies after sign-in so the next time
// the user signs in, the browser does not assume the user is already signed
// in
[viewController setBrowserCookiesURL:[NSURL URLWithString:@"http://api.dropbox.com/"]];

// You can set the title of the navigationItem of the controller here, if you want.

[[self navigationController] pushViewController:viewController animated:YES];

I have tried editing the of the library but to no success .

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top