2012-03-20 3 views
0

Android 앱에 Google 캘린더를 통합하려고합니다. 사용자는 이벤트 정보에 액세스하기 위해 권한을 부여해야합니다. 승인 요청 URL을 작성하는 데 GoogleAuthorizationRequestUrl을 사용합니다.GoogleAuthorizationRequestUrl이 잘못된 요청 URL을 작성합니다.

String url = new GoogleAuthorizationRequestUrl(CLIENT_ID, 
        "http://localhost", 
        "https://www.googleapis.com/auth/calendar.readonly").build(); 

GoogleAuthorizationRequestUrl 빌드의 URL은 다음과 같습니다 :

https://accounts.google.com/o/oauth2/auth?b=https://www.googleapis.com/auth/calendar.readonly&client_id=CLIENT_ID&redirect_uri=http://localhost&response_type=code

대신

(내가 문자열 CLIENT_ID에 의해 원래의 클라이언트 ID를 대체 아래의 코드에서) 코드는 다음과 같습니다

https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/calendar.readonly&client_id=CLIENT_ID&redirect_uri=http://localhost&response_type=code

다른 말로하면 "scope = https : //www.googleapis.com/auth/c URL에 alendar.readonly "하지만"b = https : //www.googleapis.com/auth/calendar.readonly "가 있습니다.

이상한 점은 게시를 위해 APK를 준비 할 때만 잘못된 요청 URL이 표시된다는 것입니다. 디버그 환경에서 GoogleAuthorizationRequestUrl은 올바른 URL을 작성합니다.

누구나이 동작에 대한 아이디어가 있습니까?

감사합니다, 누군가가 솔루션을 찾고이 게시물을 읽을 경우 -Ali

답변

0

, 내 implementaiton는 proguard.cfg에 다음 두 항목을 추가하여 실행되었다 :

-keep class com.google.api.client.** { *; } 

-keep class com.google.api.services.calendar.model.** { *; } 
관련 문제