5

I'm using chrome custom tabs to login with strava. I'm able to authorise the app, but the chrome custom tabs is not redirecting back to my app on reaching redirection.

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data
       android:host="sample.example.com"
       android:pathPrefix="/"
       android:scheme="http" />
</intent-filter>

How can I redirect back to app when chrome custom tabs goes to redirect the URI?

Natalie Hedström
  • 2,607
  • 3
  • 25
  • 36
Victor
  • 4,171
  • 1
  • 29
  • 37

2 Answers2

3

According to this: https://code.google.com/p/chromium/issues/detail?id=536037 the URI must have a custom scheme or the intent to the app will not be launched.

Try a URI like strava://callback or sample://example.

Also, make sure the URI defined in the intent matches the redirect_uri parameter used as well as the one registered to your app.

Hennessy
  • 128
  • 6
  • But strava only support http[s] scheme , so custom tabs will handle that intent. URI like sample://example is not supported in domain box – Victor Feb 09 '16 at 04:38
  • Then you need to make sure you previously select the app to handle that type of url. See 1. of ian's comment at the link. If you previously selected the app as the default handler then the redirect will work. – Hennessy Feb 09 '16 at 21:13
  • You saved my day. Thanks! – Alexei Artsimovich Mar 01 '19 at 11:27
0

Currently strava supports only http[s] scheme.
I think only fitbit support custom scheme for getting callbacks to app from chrome custom tabs.

Victor
  • 4,171
  • 1
  • 29
  • 37