06-01-2015 15:43
06-01-2015 15:43
Hi,
I've registered to get push notifications. I've used the following url format to create a subscription /1/user/-/apiSubscriptions/320.json. My understanding is I should get callbacks when changes are detecting on device sync for all metrics ie foods, activity, sleep, body. My user granted all scopes. My endpoint correctly receive notifications when my user sync the device. However, I am only getting notification when activities changed ie no sleep/body or foods pushes. I thought the subs url I am using would allow me to receive all metrics that have changed but all I seem to get are activities notifications.
What am I missing?
06-04-2015 10:36
06-04-2015 10:36
What you're describing it correct behavior.
Fitbit notifies you that something had changed. It's your application's decision whether go and fetch this change from Fitbit API or not.
06-04-2015 11:01
06-04-2015 11:01
Thanks Ivan! I got that. My issue is when I sync my device all I see are notifications with collection_type set to activities. Was expecting sleep collection types when I sync my device first thing in the am. Obviously that data changed yet no sleep notifications. Reading the subscription docs I should be getting one of activities, food, sleep, body. But only seeing activities notifications. Are you saying that I will never get a collection_type=sleep and it is my responsibility to check sleep and other metrics upon activities changes?
06-04-2015 11:08
06-04-2015 11:08
The sleep edetection does not happens immediatelly. So it's not guaranteed that you'll get it as a first thing in the morning when you wake up.
Once fitbit servers detect new sleep was logged it will send yuo push notification.