republik / app

The app: a thin wrapper for persistent auth, app store presence, notification, background audio and convenience.
https://www.republik.ch/app
Other
11 stars 2 forks source link

Fixes Android: no double play and no canOpenUrl #266

Closed tpreusse closed 2 years ago

tpreusse commented 2 years ago

I was able to reproduce the double play issue on Android in my emulator and managed to fix it there.

And I've created a patch to skip canOpenURL in the webview. Make sure to re-run yarn install or the postinstall script.

ovbm commented 2 years ago

awesome! will test after lunch. How did you figure out it was related to the audioId?

tpreusse commented 2 years ago

I debugged with console.log and realized that it called TrackPlayer.add twice in quick succession (maybe 1ms). TrackPlayer.getCurrentTrack, TrackPlayer.reset and TrackPlayer.add seem to be not race condition safe on android. Which then lead down a path with more stable audioIds instead of auto play boolean etc.