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
Xcode Swift: Could Not Insert New Outlet Connection
How to Show Cluster for Mkpolyline with Geojson Data View in iOS Swift
Syntax to Create Dictionary in Swift
Working Out The Start and End of a Day. Swift
Why Does Editing a Textfield Throw a Nsinvalidargumentexception
Functional Programming Way of Doing Array Conversion
Trim Video Always Fail When Use Avassetexportpresetpassthrough
Calculate Age with Textfield Swift 4
Collision Detection Leading to Color Detection
Firebase Cloud Firestore - Initializing a Collection
Nstimer() - Timer.Invalidate Not Working on a Simple Stopwatch
Saving a Screen Recording with Rpscreenrecorder Start Capture
How to Stop Dispatchgroup or Operationqueue Waiting
Swift 4, Simultaneous Access to Tuple Members as Inout
Uiscrollview Controller Not Scrolling Fully
How to Update User Interface on Core Data
How to Read The Property Values of a JSON Error Object Using Combine in Swift