Cancel
Showing results for 
Search instead for 
Did you mean: 

Source example of sending exercise data to a user's profile

Hello all,

 

does anybody know/have a complete code example which demonstrates how to send data (from an exercise, run) from the Ionic to a users profile?

 

I still couldn't understand how this works, although I studied the guides... :-/

 

Thanks
Capitano

Accepted Solution
0 Votes
4 REPLIES

I haven't seen a complete example of this, but we have the SDK OAuth example which demonstrates how to setup the Web API connection and make a query against it, then there are the Web API docs for logging activities.

Accepted Solution
0 Votes

Is this OAuth example running on the simulator?

 

I get the error message

 

Ashampoo_Snap_2018.03.21_21h11m34s_005_.png

But I don't know if I did something wrong or whether the example doesn't run on the simulator.
I copied all the source correctly from github to the Fitbit studio project.

 

Regards

Accepted Solution

This example works great in the simulator but on the iPhone (6+) when I set my Fitbit login information and allow permissions, it redirects correctly but Safari says "Cancel or Open in Fitbit". Cancel gives a white screen and Open in Fitbit opens the Fitbit mobile application to the same Application Settings screen. Neither option (Cancel or Open in Fitbit) actually logs me in and I am unable to use this example outside of the simulator. 

 

This makes me hesitant to continue as I am not sure that this function will work in anything that I create.

Accepted Solution
0 Votes

@danfare wrote:

This example works great in the simulator but on the iPhone (6+) when I set my Fitbit login information and allow permissions, it redirects correctly but Safari says "Cancel or Open in Fitbit". Cancel gives a white screen and Open in Fitbit opens the Fitbit mobile application to the same Application Settings screen. Neither option (Cancel or Open in Fitbit) actually logs me in and I am unable to use this example outside of the simulator. 

 

This makes me hesitant to continue as I am not sure that this function will work in anything that I create.


This is the error message I am getting in Fitbit Studio after tapping 'Cancel' or 'Open in Fitbit' on the iPhone

[10:46:08 AM]Unhandled promise rejection {
    column = 1854;
    line = 5;
    sourceURL = "https://app-settings.fitbitdevelopercontent.com/static/js/companion-settings.d49a76f6.js";
}

That line/column appears to be where the OAuth URL is being built. 

I have my settings/index.jsx setup using the client ID and client secret provided when I registered my application. The file, otherwise is identical to https://github.com/Fitbit/sdk-oauth/blob/master/settings/index.jsx

Accepted Solution
0 Votes