fitbitter
fitbitter copied to clipboard
Web View not closing after successful Authentication
I have successfully integrated Fitbitter and the login and subsequent permission page, the app is redirecting to the redirection url. I am also getting the Authorization Code through Uni Link stream listener.
But everything is happening in background while the web view stays at the top. It never closes and Fitbit.com permission page comes back again. Is there any way to close the WebView after successful authentication. I am on a 7th generation iPad
.
I think you are not providing a correct redirect Uri.
Actually, what I have found out after thorough inspection is that - the redirection is working fine but in return, it always showing user has cancelled the authentication process. As I was accessing other datas after authentication those processes were showing errors and it seemed like the redirection was not happening.

I have used uni_links: ^0.5.1 to check what links I am getting back. It returns with the correct values
.
Ok, can you copy&paste the piece of code where you are calling Fitbitter.authorize?
String? userId = await FitbitConnector.authorize( context: context, clientID: Strings.fitbitClientID, clientSecret: Strings.fitbitClientSecret, redirectUri: Strings.fitbitRedirectUri, callbackUrlScheme: Strings.fitbitCallbackScheme);
The only other "normal" bug can be that you used wrong fitbitRedirectUri
and callBackUrlScheme
. Could you please check this?
@subhoalmighty I am facing the same issue, it would be great if you can share the solution if you got any.
Is the browser that you are using (the one that pops up) WebView? Or is it Chrome/Safari?
It is webview
That's why you are experiencing the issue! For some reason webview does not close itself. I can assure you that the problem will disappear if you use Chrome.
https://user-images.githubusercontent.com/73571511/179423528-b6410df3-f095-482e-9595-9c1cedb1aed2.mp4
See this is the issue I am facing
Ok, the error seems suggesting that you are not setting the right URL SCHEME. Please check your manifest and how you are using the authorize() method.
In my cause i have resolved that issue by removing :// from url scheme in dart code String? userId = await FitbitConnector.authorize( context: context, clientID: fitbitClientId, clientSecret: fitbitClientSecret, redirectUri: 'myapp://fitbit', callbackUrlScheme: 'myapp');
Any update on this. Facing the same issue. Android working fine. In iOS not redirecting to my app
I am closing this since I just run the example app in iOS and Android and it works fine.