Is there an alternative to (deprecated) canOpenURL in iOS 9?

I use apple canOpenURL: and openURL: methods to detect and open another application. But since these methods are deprecated in iOS9, they return NO.

Is there an alternative to managing this?

thanks

+5
source share
3 answers

You need to point the whitelist to your plist

<key>LSApplicationQueriesSchemes</key> <array> <string>urlscheme</string> <string>urlscheme2</string> <string>urlscheme3</string> <string>urlscheme4</string> </array> 

See details

iOS 9 made some minor changes to the processing of the URL scheme.

More details

+7
source

Here you can find some information.

as stated in the article:

Prior to iOS 9, applications were able to call these methods on any arbitrary URLs. Starting with iOS 9, applications will need to announce which URL schemes they would like to test and open in the application’s configuration files as they are sent to Apple. This is essentially a whitelist that you can modify or add by sending an Apple update. It seems that some common URLs handled by system applications, such as "http", "https", need not be explicitly white.

In short: Apple wants to prevent apps from scanning a user’s device and know which apps are installed

So, to answer your question: there really is no solution, because the apple wants to precisely prevent this behavior

+2
source

In some contexts, if you need to open arbitrary deactivations, Universal application links may be the solution: you point to the website the application (which should implement this behavior), and iOS 9 automatically deactivates the adhoc application.

+1
source

All Articles