0
GTMOAuth를 사용하여 dropbox에 성공적으로 로그인했지만 응답이 반환되면 대리인에게 콜백을 보낼 수없는 것 같습니다. 이 코드는 로그인 ..GTMOAuth를 통해 REST API를 사용하여 성공적인 로그인 보관함에 대리인 얻기
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];
나는 라이브러리의 편집을 시도했지만 성공하지 못했습니다.