iOS Check if Music App is installed for MPMediaPicker

I would like to use the MediaPlayer in Swift 5 to have a user select a song for use in my app.

This should be possible using MPMediaPicker using this official Apple documentation.

However, it seems this documentation is incomplete.
If the user does not have the Apple Music app installed, then upon presentation of MPMediaPickerController, they are presented with the error alert "Internal Error", "The requested app extension could not be found" (image). This is undesirable, uninformative to the user and seemingly unpreventable.

This is also irregardless of having correctly set the NSAppleMusicUsageDescription key in Info.plist and having the appropriate (authorized) MPMediaLibraryAuthorizationStatus.


The necessity of having the Apple Music app installed is mentioned nowhere in Apple's documentation, which is lacking.
Secondly, there appears to be no way (that I could find on the Internet) to then manually check beforehand if the Apple Music app is installed.
_____

How can my app determine if the Apple Music app is installed, in order to prevent presenting a MPMediaPickerController if there is no music app installed and so prevent the uninformative and undetectable error displayed otherwise?
Kind regards,
Isaiah

Post not yet marked as solved Up vote post of IsaiahvH Down vote post of IsaiahvH
3k views

Replies

There is a suggestion of it being needed to use the system player at least...

https://developer.apple.com/documentation/mediaplayer


EDIT:

A possible way to detect the music app

https://stackoverflow.com/questions/41545283/how-to-check-app-is-installed-or-not-in-phone

The fact that there is still no solution to this issue is disheartening.