0
votes

I'm integrating Google Calendar in my Android app. A user needs to authorize in order to access the events information. I use GoogleAuthorizationRequestUrl for building the authorization request URL. The code is as follows (in the snippet below I replaced the original client id by the string CLIENT_ID):

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

The URL which GoogleAuthorizationRequestUrl builds is:

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

instead of

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

In other words I expect to have "scope=https://www.googleapis.com/auth/calendar.readonly" in the URL but I have "b=https://www.googleapis.com/auth/calendar.readonly".

The strange thing is, I get the faulty request URL only when I prepare my APK for publishing. In my debug environment GoogleAuthorizationRequestUrl building a correct URL.

Does anybody have an idea about this behavior?

Thanks, -Ali

1

1 Answers

0
votes

In case anybody will read this post searching for a solution, I got my implementaiton running by adding the following 2 entries in proguard.cfg:

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

-keep class com.google.api.services.calendar.model.** { *; }