Skip to content

NowPlayingTemplate Is Not Working  #185

Open
@syedslegend786

Description

I have a working react native audio podcast player app, built using React Native Track Player.
My client requested to allow app to run in Android Auto. I came to know about this library. I was exploring, but the main template
NowPlayingTemplate is not working. When i push template the app stop running and closed.

This is my code:

const template = new NowPlayingTemplate({
      buttons: [
        {
          id: 'foo',
          type: 'more',
        },
        {
          id: 'demo',
          type: 'playback',
        },
        {
          id: 'baz',
          type: 'image',
          image: require('../images/star.png'),
        },
      ],
      albumArtistButtonEnabled: true,
      upNextButtonTitle: 'Tester',
      upNextButtonEnabled: false,
      onUpNextButtonPressed() {
        console.log('up next was pressed');
      },
      onButtonPressed(e) {
        console.log(e);
      },
    });
    CarPlay.enableNowPlaying(true);
    CarPlay.pushTemplate(template);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions