Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

(Android) app stuck on loading after logging into browser and running okay on iOS

when I first time click login button it ask me for login info for Fitbit then after I press login it keep showing loading icons instead of returning me access token . 

this is the function i am using 

function OAuth(client_idcb) {
Linking.addEventListener("url"handleUrl);
function handleUrl(event) {
Linking.removeEventListener("url"handleUrl);
const [, query_string] = event.url.match(/\#(.*)/);
const query = qs.parse(query_string);
 
cb(query.access_token);
}

const oauthurl = `https://www.fitbit.com/oauth2/authorize?${qs.stringify({
client_id,
response_type: "token",
scope: "heartrate activity activity profile sleep",
redirect_uri: "fitbit://fit",
expires_in: "31536000",
})}`;

Linking.openURL(oauthurl).catch((err=>
console.error("Error processing linking"err)
);
}
Please get back as soon as possible , thanks in advance 
Best Answer
0 Votes
3 REPLIES 3

App is built with React Native, title should read: React Native (Android) app stuck on loading after logging into browser and running okay on iOS.

Best Answer
0 Votes

Hello @s.m.minert I've moved this and your other post to the API development board

Best Answer
0 Votes

Hi @s.m.minert 

 

Your redirect URL looks like it is pointed to the Fitbit app.   Instead, it should point to an entry point in your application.   For example myapp://callback.

 

Gordon

Gordon Crenshaw
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
Best Answer
0 Votes