03-14-2024 07:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

03-14-2024 07:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm creating a iOS and Android mobile application using the Ionic framework.
I've configured everything for the OAuth 2.0 and it works fine for Android, but in the case of iOS, I'm having problems launching the app again after the Authentication is completed. This is because Fitbit requires using https in the redirect URL instead of a custom URL (for example myAppName://callback, if I use the custom URL it works) and Safari browser tries to go to this URL instead of opening the app.
Could you please help me here.
03-14-2024 16:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



03-14-2024 16:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @AGallego,
Welcome to the forums!
Could you clarify the behavior you're experiencing on iOS after the user consents in the authorization flow? After consent is granted, does an error appear, preventing the user from being redirected back to your application? Could you also PM your redirect URL and client ID to me?
Thanks!

03-15-2024 01:28 - edited 03-15-2024 01:30
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

03-15-2024 01:28 - edited 03-15-2024 01:30
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @JohnFitbit,
the client ID is "23RVJ8", the expected behaviour is like in Android (go to the browser, introduce google credentials, be redirected to the redirect URL and automatically return to the app). In the case of iOS, I tested with 2 different redirect URLs (here the snapshots with results obtained):
redirect url "ubicardio"
redirect url "https"
- https://fitbitcallback in this case after the redirection the safari browser says it can't open the URL, and my app doesn't receive the redirect URL event (I have a appUrlOpen listener). This is the configuration in the Info.plist file:
- ubicardio://fitbitcallbak in this case after the redirection the safari browser turns to white, and my app receives the redirect URL event (I have an appUrlOpen listener). This is the configuration in the Info.plist file:

03-20-2024 07:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



03-20-2024 07:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @AGallego
In your iOS application, are you using the SFSafariViewController class when displaying the authorization page? See Displaying the Authorization Page.
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google

03-20-2024 07:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

03-20-2024 07:40
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @Gordon-C,
yes, I'm using the browser plugin from Capacitor which uses SFSafariViewControlled. Everything works as expected, I can see the Fitbit Login in both, Android and iOS, and the redirection link includes the codes I need for obtaining Tokens.
The problem is related to the redirection to the app once the login and redirection are finished. When I configure it as redirect URL ubicardio:// it doesn't try to open the app or show any message, but when I paste in the Safari browser ubicardio:// it asks me If I want to open the app (this is the first problem).
The second problem is that Fitbit says the redirect URL should be https, but when you are programming mobile applications it's usual to configure "appName://" as the redirect URL (as in the case of Fitbit, fitbit://).
An option that works for me is to include an intermediate website (https) as the redirect URL which is in charge of managing the redirection and opening of the app. Is this approach valid?
Best,

03-20-2024 13:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



03-20-2024 13:28
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
You can use custom domains, such as ubicardio://. However, the URL needs to be absolute and point to a specific location. For example, ubicardio://myAppLocation or ubicardio://myAppLocation/callback. See if changing your redirect URL to one of those resolves the problem.
Senior Technical Solutions Consultant
Fitbit Partner Engineering & Web API Support | Google
