I`m trying to control the Spotify using my custom switch app. Creation works OK but each communicaction ends with nil or undefined value. For example this snipped prints "??":
func applicationDidFinishLaunching(_ aNotification: Notification) {
let player = SBApplication(bundleIdentifier: "com.spotify.client")! as SpotifyApplication
switch player.playerState {
case .paused:
print("paused")
case .playing:
print("playing")
case .stopped:
print("stopped")
default:
print("??")
}
}
Any idea what am I doing wrong?
Thanks to the @matt I found the solution - Info.plist was missing "Privacy - AppleEvents Sending Usage Description"