androidkotlinaudiompnowplayinginfocenter

Android TV: Now Playing Card shown but app still rejected


I'm making my radio-app available for Android TV.

All issues solved but my app is still rejected:

No Now Playing notification [card]" Your App does not contain a “Now Playing” notification [card] for when the user has selected the HOME button within the app. Please refer to our Displaying a Now Playing Card documentation for more details.

In test everything works oke. The Now Playing Card is shown when the user presses Home in the app. And when selecting the Now Playing Card the app is opened again. I've no clue what's going wrong here. Has anyone experience the same problem? And how was is resolved? It's impossible to get in to contact met Google to clear up what's going wrong.

I use the code as explained by Google:

val intent = Intent(applicationContext, NowPlaying::class.java)
val pendingIntent =  PendingIntent.getActivity(this, 99, intent, PendingIntent.FLAG_IMMUTABLE)

mediaSessionCompat!!.setSessionActivity(pendingIntent)

I found two questions about the same but no answer was provided.

The Now Playing Card is shown on the screensaver:

enter image description here And in the Home Screen:

enter image description here

Update: I did some testing ... pressing the Now Play Card works on Google TV API31 and on Chromecast with Google TV API31.

But not on Android TV API31. When pressing "open" nothing happens.

enter image description here

Anyone an idea to get the "open" button working?

This is the code specific for TV:

if (mDevice == Device.TV) {

        //GoogleTV API31 werkt klik op nowplayingcard
        //AndroidTV API31 werkt klik NIET op nowplayingcard
        //Chromecast With Google TV werkt klik op nowplayingcard

        //click op stop in AndroidTV roep onPause() aan

        val intent = Intent(applicationContext, NowPlaying::class.java)
        val pendingIntent =  PendingIntent.getActivity(this, 99, intent, PendingIntent.FLAG_IMMUTABLE)

        mediaSessionCompat!!.setSessionActivity(pendingIntent)

    }

If I remove that code my app is opened but not the NowPlaying page as should be.


Solution

  • Somehow my approach was good. Google accepted my app for Google/Android TV (probably after an update for Google/Android TV. Ik looks like that not opening my app on Android TV was a Android bug somehow.