2013-08-16 5 views
0

GTL framework을 사용하여 Google Plus를 내 코코아 애플리케이션에 통합했습니다.Google Plus API 승인 : request_visible_actions

새로운 순간을 삽입하려고하면 오류 401 (인증되지 않음)으로 실패합니다. this에서 사용자가 인증 페이지로 리디렉션하는 동안 request_visible_actions 매개 변수를 포함하여이 문제를 해결했습니다. 그러나 그것을하는 방법?

URL을 자동으로 생성하는 GTMOAuth2WindowController의 인스턴스가 있습니다. 그렇다면 request_visible_actions 매개 변수를 어떻게 추가 할 수 있습니까? 그럴 수 없다면 전체 URL을 만드는 방법은 무엇입니까?

+0

당신이 내게 보여 수를 어떻게 설정 구글 플러스 순간 POST 요청을? 광산이 작동하지 않습니다. ((http://stackoverflow.com/questions/24061521/cannot-insert-moment-google-plus-api) – Supertecnoboff

답변

3

나는 문제를 해결했다! 나는이 같은 GTMOAuth2WindowController 만들어야했습니다 :

GTMOAuth2Authentication *auth = [GTMOAuth2SignIn standardGoogleAuthenticationForScope:kGTLAuthScopePlusLogin clientID:kClientID clientSecret:kClientSecret]; 
NSString *authURLString = [[[GTMOAuth2SignIn googleAuthorizationURL] absoluteString] stringByAppendingString:@"?request_visible_actions=http://schemas.google.com/AddActivity"]; 

NSBundle *frameworkBundle = [NSBundle bundleForClass:[GTMOAuth2WindowController class]]; 
GTMOAuth2WindowController *windowController = [GTMOAuth2WindowController controllerWithAuthentication:auth 
                             authorizationURL:[NSURL URLWithString:authURLString] 
                              keychainItemName:nil 
                              resourceBundle:frameworkBundle]; 
+0

연결 하시겠습니까? "? request_visible_actions = http : //schemas.google.com/AddActivity "를"https://accounts.google.com/o/oauth2/auth/ "으로 변경 하시겠습니까? – Supertecnoboff