birkir / react-native-carplay

CarPlay with React Native
https://birkir.dev/react-native-carplay/
MIT License
655 stars 108 forks source link

Developing now playing template for android auto #175

Open thimslogituit opened 6 months ago

thimslogituit commented 6 months ago

We want to use this library for both ios and android. Now template is working with ios but not supported in android.

We would like to take this library and modify it so that it supports now playing screen in android as well. But we are not sure how to proceed with it. Can anyone please guide us on how to develop feature or if there is some work around would be great.

DanielKuhn commented 6 months ago

Which media player are you planning to use? We use react-native-track-player for audio playback. For iOS/CarPlay it integrates nicely with this package and for Android Auto there's this branch of react-native-track-player which supports lists and a NowPlaying screen for Android.

thimslogituit commented 6 months ago

Thanks for the response @DanielKuhn We have request to use different players other than you mentioned above, we want to use exo player for android and AV player for ios.

lovegaoshi commented 6 months ago

have you reviewed google's android auto guidelines? in short you need to expose the mediaSession token used when building exoplayer, and add in appropriate functions while declaring your exoplayer's foreground service as a MediaLibraryService. This is really out of scope for a standalone library that builds generic car templates, but rather the audio library's job; eg. see audio_service from the flutter community as an example.

syedslegend786 commented 4 months ago

Which media player are you planning to use? We use react-native-track-player for audio playback. For iOS/CarPlay it integrates nicely with this package and for Android Auto there's this branch of react-native-track-player which supports lists and a NowPlaying screen for Android.

Hi, I am developing a react native app using react-native-track-player, i want my app to work on android-auto. I tried using react-native-carplay, byt NowPlayingTemplate is not woking. If you have any example application with reactnative, please share the repo, it will help alot.