Reading the documentation for UIApplicationDelegate - application:openURL:options
Return:
YES if the delegate successfully handled the request or NO if the attempt to open the URL resource failed.
What does returning YES
vs NO
impact? Is it just a convenience if you happen to be sub-classing your app delegate and might want to let super
handle the invocation? The return value doesn't seem to affect the behavior of UIApplication
itself in any obvoius way.
The OpenURL method runs with the same permissions as your app itself. For example, if your app is running as a WebGL player in a desktop web browser, it will not be able to access local files on the machine, because the WebGL platform itself runs inside a security sandbox which prevents that.
If your app uses OpenURL to open URL strings which come from a third party, or which are put together using any user-supplied data, the user-supplied data should be considered untrusted and may be used to run arbitrary code under the same permissions of your app itself.
The URL resource to open. This resource can be a network resource or a file. For information about the Apple-registered URL schemes, see Apple URL Scheme Reference. A dictionary of URL handling options.
The open url deluge task when executed takes the user to the specified url. The URL can also be opened in iframe. Support for iframe provides huge opportunities for developers to improve the interface/interaction of their applications and provide Web 2.
application:openURL:options
should be implemented if the app opens deep links including waiting for a callback from another app as facebook login.
The URL/URI parameter value should contains the needed information to let you figure out to which view controller the app should be re-directed to.
One example with facebook callback there is facebookSDK method that can be called and it will handle the URI parsing for you.
If you decide to open the app you should return YES/true, and then proceed with re-directing. Otherwise, return NO/false.
If app accepts info. from 3rd party apps. This method allow you to check the validity of this info. and regardingly accept the request or reject it.
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