user5345550
user5345550

Reputation:

Get tap event Lock Screen Control(MPRemoteCommandCenter)

I have implemented Avplayer for play audio. I have used MPRemoteCommandCenter to get access on lock screen. I can get all access by:

    let commandCenter = MPRemoteCommandCenter.shared()

    commandCenter.pauseCommand.addTarget { (event) -> MPRemoteCommandHandlerStatus in
        //Update your button here for the pause command
        return .success
    }

    commandCenter.playCommand.addTarget { (event) -> MPRemoteCommandHandlerStatus in
        //Update your button here for the play command
        return .success
    }

But I want to detect when user taps on music title or logo or player from lock screen. It open our app. is It Possible to get?

I want to open a controller when user taps on music player from lock screen.

Upvotes: 2

Views: 528

Answers (1)

matt
matt

Reputation: 535139

You can respond when your app is activated, but there is no way to learn that it was activated because the user tapped on the music player in the lock screen.

Upvotes: 1

Related Questions