SweetzpotAS / StravaZpot-Android

A fluent API to integrate with Strava on Android apps
70 stars 36 forks source link

Endless loop after "Cancel" click in Auth Page of Strava #4

Closed dgngulcan closed 7 years ago

dgngulcan commented 7 years ago

Webview enters an endless loop with a progressBar after clicking "cancel" for authorization in the auth webpage of Strava

truizlop commented 7 years ago

Could you verify if this is an issue of the library or something related to Strava's website? If it is something with the library, please, provide detailed steps on how to reproduce the issue, with code if necessary.

dgngulcan commented 7 years ago

After starting StravaLoginActivity with my credentials, It opens a WebView with Strava's authorization web page that asks for my permission for my app. When I click "authorize", I am able to get the code at onActivityResult as expected. When I click "cancel", It redirects to another page with just a progressBar

What I suspect is that the redirected URL is not caught in StravaLoginActivity's

..
private boolean handleUrl(Uri uri) {
                String redirectURL = getIntent().getStringExtra(EXTRA_REDIRECT_URL);
                if(uri.toString().startsWith(redirectURL)) {
                    String code = uri.getQueryParameter("code");
                    return makeResult(code);
                }
                return false;
            }
..

Nowadays I'm pretty busy with work and side projects. I may fork and fix your awesome library when I can find time if you are busy too!

truizlop commented 7 years ago

Thansk @dgngulcan, I will investigate the issue and publish an update as soon as possible. I'm glad that you like the library and using it 😄

truizlop commented 7 years ago

Version 1.1.2 has been published solving this issue. Please, verify that it is solved and close the issue if so. Thanks for your collaboration!

dgngulcan commented 7 years ago

All good! Thank you too! :) The app that I am going to use your library is Paxira If you cycle too, would like to get your critique on that!

truizlop commented 7 years ago

We'll take a look at it! Thanks!