SweetzpotAS / StravaZpot-Android

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

Is there any function that can deauthorize? , seems like there is no deauthorize function on new released version #16

Closed StevenStarz closed 6 years ago

StevenStarz commented 6 years ago

@truizlop

StevenStarz commented 6 years ago

AuthenticationConfig config = AuthenticationConfig.create() .debug() .build(); AuthenticationAPI authenticationAPI = new AuthenticationAPI(config); authenticationAPI.deauthorize() .execute(); above is my code, i try to implement deauthorize base on what you do in test module

truizlop commented 6 years ago

I'm sorry, could you describe the error or misbehavior you are experimenting? What is your expected result? What is the actual outcome? Which steps are you following?

truizlop commented 6 years ago

Also, make sure you are using the proper library version. Last version published is 1.3.

StevenStarz commented 6 years ago

i want to create 2 button with action connect to strava and disconnect to strava, for now connect to strava is working, but i'm still figure out how to disconnect from strava, and i see on strava documentation http://developers.strava.com/docs/authentication/ there is deauthorize, but i can't find the deauthorize implementation on you source code @truizlop

truizlop commented 6 years ago

It was included in the last version of the library. If you don't have access to it, it is because you are not using the latest version, as I suggested in my previous comment. Update your gradle file to version 1.3.

StevenStarz commented 6 years ago

@truizlop okay i see the function now, after i update the version

StevenStarz commented 6 years ago

@truizlop Thanks for your help

StevenStarz commented 6 years ago

@truizlop do i need to provide code or access token, when calling deauthorize? (Because it always throw StravaUnauthorizedException)

truizlop commented 6 years ago

You always need to provide a valid config object. If it is throwing that exception, it may be because you are already deauthorized.

StevenStarz commented 6 years ago

@truizlop i already trying to reauthorize and using the token to ensure is connected to strava, but still got the same issue

StevenStarz commented 6 years ago

@truizlop

truizlop commented 6 years ago

With the information you are providing, there's little I can do to help. You need to check the debug logs to see what is going on. Check that you are able to use other parts of the library and check that this is actually a problem with StravaZpot before posting an issue here.

StevenStarz commented 6 years ago

@truizlop is working now, but i'm not using the function that you provided, I create my own request, then set the authorization header with access token, and it's working now