the view above the now playing view on watchOS

Hi. I am a Korean so my English is not perfect ... please understand it


Let`s check the link below.

https://help.apple.com/assets/5DADE53F680CE2176254AEEA/5DADE546680CE2176254AEF4/en_US/4845cb1e2a5bb621ab5d37f029dc6606.png


You could see 3 buttons for more options on the now playing view.

In the document of apple, we cannot add any views on the now playing view.


So how can I do this like apple's application. please save me.

Hello @jungsufromgwanak-gu,


Third party applications can add a few specific actions to the now playing view by registering a handler on any of the following feedback commands from MPRemoteCommandCenter:


    // Feedback Commands
    // These are generalized to three distinct actions. Your application can provide
    // additional context about these actions with the localizedTitle property in
    // MPFeedbackCommand.
    open var likeCommand: MPFeedbackCommand { get }
    open var dislikeCommand: MPFeedbackCommand { get }
    open var bookmarkCommand: MPFeedbackCommand { get }


These will be exposed in the now playing view on watchOS with a different button though; instead of a button with an ellipsis (...), you'll see a button with three horizontal bars.


I hope this helps.


Best regards,

Hi JoeKun. Really thanks to your reply.


I have tried many times as you taught me a few days ago.

I tried to add almost all of the commands. But I cannot see it anyone.


- I tried it both simulator and real device

- I do not prepare any plyable-contents because the apple's not playing app can show the bottom buttons without that.


My example is here! please let me know. Big thanks in advance.


class PlayerInterfaceController: WKInterfaceController {


var like: Any!

var dislike: Any!

var bookmark: Any!


override func awake(withContext context: Any?) {


super.awake(withContext: context)


let shared = MPRemoteCommandCenter.shared()


shared.likeCommand.isEnabled = true

shared.bookmarkCommand.isEnabled = true

shared.dislikeCommand.isEnabled = true


shared.likeCommand.localizedTitle = "HAPPY"

shared.likeCommand.localizedShortTitle = "HB"

self.like = shared.likeCommand.addTarget { (event) -> MPRemoteCommandHandlerStatus in

return .success

}


shared.dislikeCommand.localizedTitle = "UNHAPPY"

shared.dislikeCommand.localizedShortTitle = "UB"

self.dislike = shared.dislikeCommand.addTarget { (event) -> MPRemoteCommandHandlerStatus in

return .success

}


shared.bookmarkCommand.localizedTitle = "BOOKMARK"

shared.bookmarkCommand.localizedShortTitle = "BK"

self.bookmark = shared.bookmarkCommand.addTarget { (event) -> MPRemoteCommandHandlerStatus in

return .success

}

}

}


Best regards

Hello @jungsufromgwanak-gu,


In order to see these buttons, you actually need to prepare playable contents. These buttons come from the current now playing state, and if there's nothing playing, the now playing view on watchOS won't look for these commands.


I hope this helps.


Best regards,

Thanks a lot. But I have a question.


Apple's now playing app shows three buttons regardless of the plyable contents on the bottom.

How can make like this?


Your answer is helpful.

Thanks a lot! JoeKun

Hello @jungsufromgwanak-gu,


I understand your desire to match the behavior of Apple's Music app to show this button even without preparing playable contents. However, it seems like that is just not currently supported.


Nevertheless, we value your feedback, and if you feel strongly that 3rd party applications should be able to match this behavior, I think your best bet is to file an enhancement request on our Feedback Assistant website.


Thanks,

the view above the now playing view on watchOS
 
 
Q