Releases: gcappon/fitbitter
Release 2.0.4
Solves #19: Now, when using the method FitbitConnector.authorize, it is possible to specify a specific authorization scope (defined in https://dev.fitbit.com/build/reference/web-api/developer-guide/application-design/#Scopes) and token expiration time (defined in https://dev.fitbit.com/build/reference/web-api/authorization/authorize/).
The new constructor is defined as:
static Future<FitbitCredentials?> authorize(
{required String clientID,
required String clientSecret,
required String redirectUri,
required String callbackUrlScheme,
List<FitbitAuthScope> scopeList = const [FitbitAuthScope.ACTIVITY, FitbitAuthScope.CARDIO_FITNESS, FitbitAuthScope.HEART_RATE, FitbitAuthScope.LOCATION, FitbitAuthScope.NUTRITION, FitbitAuthScope.OXYGEN_SATURATION, FitbitAuthScope.PROFILE, FitbitAuthScope.RESPIRATORY_RATE, FitbitAuthScope.SETTINGS, FitbitAuthScope.SLEEP, FitbitAuthScope.SOCIAL, FitbitAuthScope.TEMPERATURE],
int expiresIn = 28800
}) async {...}
Current available scopes are defined by the enumerator FitbitAuthScope
:
enum FitbitAuthScope{
ACTIVITY, // for `activity` scope
CARDIO_FITNESS, // for `cardio_fitness` scope
HEART_RATE, // for `heartrate` scope
LOCATION, // for `location` scope
NUTRITION, // for `nutrition` scope
PROFILE, // for `profile` scope
SETTINGS, // for `settings` scope
SLEEP, // for `sleep` scope
SOCIAL, // for `social` scope
WEIGHT, // for `weight` scope
OXYGEN_SATURATION, // for `oxygen_saturation` scope
RESPIRATORY_RATE, // for `respiratory_rate` scope
TEMPERATURE // for `temperature` scope
}
Available token expiration lifetimes are: 3600 (1 hour), 28800 (8 hours), 86400 (1 day), 604800 (1 week), 2592000 (30 days), or 31536000 (1 year).
Updates dependencies.
Release 2.0.3
Updated dependencies.
Release 2.0.2
Updated dependencies.
Release 2.0.1
Fixed some typos.
Release 2.0.0
Major release 2.0.0.
Breaking change:
Fitbit provided tokens are no longer managed by fitbitter. Now they are returned during the authorization process by the FitbitConnector.authorize()
method:
FitbitCredentials? fitbitCredentials =
await FitbitConnector.authorize(
clientID: Strings.fitbitClientID,
clientSecret: Strings.fitbitClientSecret,
redirectUri: Strings.fitbitRedirectUri,
callbackUrlScheme: Strings.fitbitCallbackScheme);
As a consequence, to fetch data it is necessary to pass the credentials to each FitbitAPIURL
constructor. For example:
See the docs for more info and examples.
New features:
- Now it is possible to fetch breathing rate data (see
FitbitBreathingRateData
) - Now it is possible to fetch cardio score (VO2Max) data (see
FitbitCardioScoreData
) - Now it is possible to heart rate variability data (see
FitbitHeartRateVariabilityData
) - Now it is possible to fetch intraday Heart data (see
FitbitHeartRateIntradayData
) - Now it is possible to fetch SpO2 data (see
FitbitSpO2Data
) - Now it is possible to fetch intraday SpO2 data (see
FitbitSpO2IntradayData
) - Now it is possible to fetch skin temperature data (see
FitbitTemperatureSkinData
)
Minor changes:
FitbitHeartData
is nowFitbitHeartRateData
- Removed
WithUserId
string from the name of APIURL related constructors encodedId
field in the Data classes is now calleduserID
Release 1.1.1
[master] release 1.1.1
Release 1.1.0
Update README.md