Search code examples
iosswiftstrava

Authorisation callback issue in strava api for iOS


I am integrating strava api's in my app. I need help regarding the authorization callback domain i.e. required during the api registration so that after the authorization the device browser opens the app again for further usage. When I try to submit the myapp:// as the callback domain it gives me error (This field must be a domain, no slashes or paths). I can't seem to enter anything that is a valid domain. Because the redirect url or uri is something that app describes in its property list. Also it adds the http in the redirect uri by itself. Example when we register myapp as url scheme in strava as well as in plist file then on hitting myapp:// in the safari browser opens the app. But the strava changes this to https://www.strava.com/oauth/authorize?client_id=*****&response_type=code&redirect_uri=http://myapp&approval_prompt=force.

Why there is http:// added in the redirect uri and also why I am not able to register myapp:// as the redirect uri ?

I have checked one older example having slashes in their redirect uri. So how that example is working and registered with slashes in redirect uri?

So, Anybody please help me in solving this issue.

Thanks In Advance.


Solution

  • I have contacted Strava Developer Support for the above said issue and got their reply that we can register myapp.com as authorisation callback domain in strava, myapp as url scheme in info.plist and myapp://myapp.com as the redirect uri for strava api.

    After implementing this, my app works well and performs the oauth flow as is supposed to do.

    I am posting this answer here so as to help anybody else facing the same issue.

    Thanks