Having Trouble with Musickit Sample App Provided by Apple

Having trouble with MusicKit sample app provided by Apple

I have found a similar question in the Apple's Dev Forums:

MPMusicPlayerController Swift4 - Ambiguous Use of Play

According to an entry writing a fix to work around the issue, you need to change this line in MusicPlayerManager.swift:

let musicPlayerController = MPMusicPlayerController.systemMusicPlayer

(musicPlayerController's type becomes MPMusicPlayerController & MPSystemMusicPlayerController with this code.)

To:

let musicPlayerController: MPMusicPlayerController = MPMusicPlayerController.systemMusicPlayer

(musicPlayerController is explicitly annotated as MPMusicPlayerController.)


In my opinion this is a bug of Swift related to SE-0156 Class and Subtype existentials and you should better send a bug report to Apple or swift.org.

Having Trouble with Apple's MusicKit SDK

SKErrorDomain code=1 is "clientInvalid" error.

Calling requestUserToken triggers iOS to ask for my Apple ID password for me. I get this error when I (the user) refuse to provide my password. I've just tried and verified this behaviour with the Apple's sample project as well. I would try to make sure "iTunes & AppStore" section on Settings app have a valid Apple ID provisioned. I would also try starting from sctratch by removing the app from the test device.

So, to answer your question; yes I can successfully can get userToken with the sample project (running on iOS 11 beta 2 physical device). The "Recents" tab is showing my player history.

Ambiguous use of play of MPMusicPlayerController in iOS11, swift4

Write

    (musicPlayerController as MPMediaPlayback).play()


Related Topics



Leave a reply



Submit