08-24-2020 15:30 - edited 08-24-2020 15:33
08-24-2020 15:30 - edited 08-24-2020 15:33
Hi,
we are working on an iPhone app where we have integrated our app with Fitbit and implemented Implicit Grant Flow for the the authentication.
Right now, unless the user updates their FitBit data by launching the FitBit app and syncing, before using our iPhone app, their data would not be registered leaving their data in the past.
Is there a way our app would know when was the last sync happened for that fitbit user?
Thanks
Ekta
Answered! Go to the Best Answer.
08-25-2020 10:49
08-25-2020 10:49
Hi @ektay
If you requested the settings scope and the user consented to share that data with your application, then the Get Devices endpoint will let you know when the user last sync'd their device. See https://dev.fitbit.com/build/reference/web-api/devices/#get-devices.
Another option is to implement the Subscription API. Anytime a user syncs their device, manually enters data or we receive data from a 3rd party application which the user has also authorized, you will receive a notification that new data is available for downloading. See https://dev.fitbit.com/build/reference/web-api/subscriptions/
Gordon
08-25-2020 10:49
08-25-2020 10:49
Hi @ektay
If you requested the settings scope and the user consented to share that data with your application, then the Get Devices endpoint will let you know when the user last sync'd their device. See https://dev.fitbit.com/build/reference/web-api/devices/#get-devices.
Another option is to implement the Subscription API. Anytime a user syncs their device, manually enters data or we receive data from a 3rd party application which the user has also authorized, you will receive a notification that new data is available for downloading. See https://dev.fitbit.com/build/reference/web-api/subscriptions/
Gordon
08-25-2020 13:13
08-25-2020 13:13
Can I use the subscription APIs in implicit grant flow. If the authorization is done through the iOS app?
08-25-2020 14:10
08-25-2020 14:10
Yes, you may. The Subscription API is not dependent on the authorization flow you use.