2014-07-19 2 views
0

범위가 kGTLAuthScopeDrive (또는 "https://www.googleapis.com/auth/drive") 인 표준 iOS Google 드라이브 SDK 로그인 메커니즘을 사용하고 있습니다. 로그인 과정에서 사용자 이름과 암호를 제공 한 후, 뷰 창을 보여줍니다로그인시 Google 드라이브 앱 권한을 제한하는 방법

 
This app would like to: 
(1) Know who you are on Google 
(2) View your email address 
(3) View and manage the files and documents in your Google Drive 

Some other text. 

Cancel Button Accept Button 

두 개의 버튼은 아이폰 5 화면의 하단을 가을 볼 및 도청까지 스크롤해야합니다. 나는 "귀하가 Google에있는 사람"또는 "귀하의 이메일 주소"를 알 필요가 없습니다. Google 드라이브 파일 만 관리 할 수있는 범위가 있나요? 스크롤하지 않고 초기보기에 동의 버튼이 표시됩니다. 또는 버튼을 표시하기 위해 자동 스크롤하는 다른 방법이 있습니까?

답변

0

불행히도 당신이 찾고있는 범위가 없습니다. Drive 'About' request을 보면 왜 처음 2 개의 결과가 나오는 지 알 수 있습니다. 파일을 관리하고이 정보를 볼 수없는 범위는 없습니다.

"kind": "drive#user", 
"displayName": string, 
"picture": { 
    "url": string 
}, 
"isAuthenticatedUser": boolean, 
"permissionId": string, 
"emailAddress": string 
0

GoogleAPI 파일 "GTMOAuth2SignIn.m"의 142 번째 행을 주석 처리하면 원하는 UI 효과가 발생합니다. 안타깝게도 로그인에 실패하고 긴 오류 메시지가 표시됩니다. 아마도 GoogleAPI 로그인 프로세스에 대한 지식이있는 사람이이를 작동시킬 수 있습니다. 라인 142 및 전체 절차는 다음과 같습니다 :

//scope = [GTMOAuth2Authentication scopeWithStrings:scope, emailScope, nil]; 


- (void)addScopeForGoogleUserInfo { 
    GTMOAuth2Authentication *auth = self.authentication; 
    if (self.shouldFetchGoogleUserEmail) { 
    NSString *const emailScope = @"https://www.googleapis.com/auth/userinfo.email"; 
    NSString *scope = auth.scope; 
    if ([scope rangeOfString:emailScope].location == NSNotFound) { 
     //scope = [GTMOAuth2Authentication scopeWithStrings:scope, emailScope, nil]; 
     auth.scope = scope; 
    } 
    } 

    if (self.shouldFetchGoogleUserProfile) { 
    NSString *const profileScope = @"https://www.googleapis.com/auth/userinfo.profile"; 
    NSString *scope = auth.scope; 
    if ([scope rangeOfString:profileScope].location == NSNotFound) { 
     scope = [GTMOAuth2Authentication scopeWithStrings:scope, profileScope, nil]; 
     auth.scope = scope; 
    } 
    } 
} 
관련 문제