I'm not talking about a UIWebView
, I want to open the mobile safari app using an NSURLRequest
.
Why? In my app, the user has already logged into our web server. I want to give the user the option of launching the webpage without having to reenter their credentials. However, I can't use a GET
because that would put their credentials in the URL.
So, can I open the safari app (not a UIWebView
) from my app with an NSURLRequest
or a POST
in some other form?
I'm going to put my neck on the line and say no — there's no way to pass an NSURLRequest
directly to Safari. The (primary) inter-application communication medium on iOS is to access URLs; there's no general mechanism for passing objects from one application to another.
I think the best you're going to be able to do is to fetch a one-time key from your web server in the app, then pop into Safari with that in the URL. And, if you can, do that via HTTPS so that the URL path and query components are only visible once TLS negotiation has succeeded. That should stop anybody else from seeing the relevant credentials and stop them from being useful even if they're obtained by some other means (such as somebody next to you copying the URL from your screen).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With