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