3

I'm trying to use a REST API for my iOS application, however, I've noticed that many sites won't allow a app-specific URL scheme for the redirect URI. In one case, only an https://... URL is allowed.

Is there a way to redirect back to an iOS app in these cases?

João Angelo
  • 56,552
  • 12
  • 145
  • 147
jpcguy89
  • 217
  • 2
  • 16

1 Answers1

1

Although there's a thing as too many redirects, just one more won't probably reach the limit. You can have your own HTTPS endpoint that redirects the request again to your app-specific URL scheme.

If you don't want to host it yourself you can do something really simple as creating a webtask that just redirects the received request and parameters back to your app.

This example in the documentation shows how to control the HTTP response within a webtask:

module.exports = function (context, req, res) {
    res.writeHead(200, { 'Content-Type': 'text/html '});
    res.end('<h1>Hello, world!</h1>');
}  

There's of course the need to review it from a security perspective in order to ensure you don't do something stupid, but that's always the case, and in theory this should be feasible.

Community
  • 1
  • 1
João Angelo
  • 56,552
  • 12
  • 145
  • 147
  • I've looked at this solution, but haven't been able to figure out how to use it to accomplish what I need. – jpcguy89 Nov 16 '16 at 21:42