Closed thunq96 closed 1 year ago
I call refreshToken with param like this:
final newCredentials = await FitbitConnector.refreshToken( clientID: FitbitHelper.clientID, clientSecret: FitbitHelper.clientSecret, fitbitCredentials: fitbitCredentials);
but response return error : https://user-images.githubusercontent.com/104921630/221084353-86881669-76c9-4b28-9b65-5dc047625449.png can you help me check it.
I think there is something wrong with the management of async calls since I see there is an asyncronous suspension going on.
Is this plugin, any useful for writing data to Fitbit id. Because I have followed all the steps, as mentioned in the document. Registered the application on Fitbit portal, provided with Client ID, Client Secret and Redirected URl. But I am not able to get the credentials, neither I am able to establish any connection between by Application and fitbitter I believe. I need help on this and I cannot even find any reference.
fitbitter is not currently able to write data to Fitbit. Anyway, establishing a connection and getting data are both working.
What should be the valid format of "callbackUrlScheme" parameter? I am getting the following error:- "Invalid argument (callbackUrlScheme): must be a valid URL scheme"
Hi! If during the app registration you set the callback url to something like "example://fitbit/auth", then your callbackUrlScheme is "example".
@gcappon Thanks for your quick response. Will try and update. Thanks
@gcappon Is there way to define scope i.e. (For e.g just grant access to weight data and do not show other parameters like temperature, sleep etc on Fitbit auth page)?
Currenlty there is not. The only way to do it right now is to fork the repo and modify manually the url at line 57 of lib/src/urls/fitbitAuthAPIURL.dart which is defining the scopes.
@gcappon Ok will check. Thanks
@gcappon I getAccessToken this code.
Future<String?> getAccessToken() async {
final currentFitbit = await getCurrentFitbit();
if (currentFitbit == null) {
return null;
}
final fitbitCredentials = currentFitbit.fitbitCredentials;
final isTokenValid = await FitbitConnector.isTokenValid(
fitbitCredentials: fitbitCredentials);
if (isTokenValid) {
return currentFitbit.accessToken;
} else {
final newFitbitModel = await refreshToken();
return newFitbitModel?.accessToken;
}
}
but I get respons e
I want call syncall data, I getAccessToken first, but in step check Token valid I see an error on function and my app was stopped because it couldn't pass await
I want call syncall data, I getAccessToken first, but in step check Token valid I see an error on function and my app was stopped because it couldn't pass await
Are you awaiting? It seems not.
I call refreshToken with param like this:
but response return error : https://user-images.githubusercontent.com/104921630/221084353-86881669-76c9-4b28-9b65-5dc047625449.png can you help me check it.