`canOpenURL` returns true for Apple Music app when it was removed from device

454 Views Asked by At

What I want

Check in my app whether Apple Music app is installed or not. For that I'm using canOpenURL() method and validate the result (boolean value).

Problem:

If Apple Music app already installed, canOpenURL() returns true, obviously. But after removing application from the real device, canOpenURL() return true as well. But expected result should be false ('cause the app isn't installed).

Additional info

I'm tested that workflow on iPhone XR, iOS 12.0.

Also, I've added in the Info.plist LSApplicationQueriesSchemes key, where wrote array with different app schemes. It's looks like

<key>LSApplicationQueriesSchemes</key>
    <array>
        <string>music</string>
        ....
    </array>

URL is next: URL(string: "audio-player-event://"). I'm also used another strings, like music:\\ and musics:\\.

I used this source to get all needed app schemes.

I'm also checked all corresponded questions on the SO (like this one), but no one has the reasonable answer.

0

There are 0 best solutions below