Signing error when implementing playbackState reporting

Hi,

I'm trying set playbackState like
Code Block swift
MPNowPlayingInfoCenter.default().playbackState = .playing

But I receive an error in console.

Code Block
[NowPlaying] [MRNowPlaying] Ignoring setPlaybackState because application does not contain entitlement com.apple.mediaremote.set-playback-state for platform

I tried to add it to applications *.entitlements file:

Code Block xml
    <key>com.apple.mediaremote.set-playback-state</key>
    <true/>

But after that I cannot even build my application due to signing error:
Code Block
Provisioning profile "iOS Team Provisioning Profile: app.name" doesn't include the com.apple.mediaremote.set-playback-state entitlement.

I use a free development certificate if it is important. Xcode version is 12.4.

Did anyone face with same issue? What do I wrong? What should I do to solve an issue?

Thanks for any help!

But after that I cannot even build my application due to signing error

Right. iOS apps can’t use arbitrary entitlements. All entitlements must be in the allowlist within the provisioning profile. And in this case you won’t be able add the entitlement to that allowlist because this is an Apple-only entitlement [1].

I’m not an expert on MPNowPlayingInfoCenter but the documentation for the playbackState property indicates that it’s a macOS thing.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Note that it starts with com.apple.. Entitlements available to third-party developers start with either com.apple.developer. or com.apple.security. or are in a very limit set of old school entitlements that have no prefix.
Thanks for the answer!

As I understand, you are partially correct. playbackState is available for MacOS but also for CarPlay implementation. Only by using playbackState I got correct behaviour with CarPlay on simulator. I'm talking about synchronisation of playback state on CarPlay system and on a phone/pad.

OK, if error caused by misalignment between provisioning profile and list of entitlements, could you/anyone tell me how to extend a profile to support additional entitlements?

I'm talking about synchronisation of playback state on CarPlay system
and on a phone/pad.

I’m sorry but I know nothing about CarPlay. I’ve added the CarPlay tag to your post in the hope that it brings it to the attention of someone who does. If not, my advice is that you open a DTS tech support incident and talk to DTS’s CarPlay specialist.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

While an implementing a CarPlay functionality I also faced with similar issue.

Correct work for CarPlay requires an entitlement "com.apple.developer.playable-content". Without it an application doesn't show an icon in CarPlay and all corresponding functionality (NowPlayingInfo) became broken.

Problem is also described here: https://blog.fethica.com/add-carplay-support-to-swiftradio/

And in an issue: https://github.com/analogcode/Swift-Radio-Pro/issues/104#issuecomment-433407949

Looks like need to: apply for CarPlay functionality at https://developer.apple.com/contact/carplay/ , but looks like this page isn't available for free and need to purchase Apple Developer Program.

Really sad for a spending 99$ 😦

Ran into this. Wanted that print line to disappear.

Solution: don't use MPNowPlayingInfoCenter.default().playbackState

Why: I only care about iOS. This doc shows that this is only for MacOS https://developer.apple.com/documentation/mediaplayer/mpnowplayinginfocenter/2588243-playbackstate

I am having the same problem but the doc clearly says iOS 11.0+ and iPadOS 11.0+. What am I missing?

Signing error when implementing playbackState reporting
 
 
Q