-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Use with "react-native-track-player" #31
Labels
Comments
@robertfernanV, this example might help you: /**
* It must be called before the app is in the background so it can register the event listener.
*/
const backgroundTask = async () => {
await new Promise((resolve) => {
// Playing listeners
const listenerChange = TrackPlayer.addEventListener('playback-state', (newState) => {
// Do stuff
if (newState.state === TrackPlayer.STATE_PLAYING) {
// Play button
} else if (newState.state === TrackPlayer.STATE_PAUSED) {
// Pause button
}
});
});
}; |
@Rapsssito thanks for answering! i going to try it. |
Rapsssito
changed the title
Use with "react-native-track-player"
[Question] Use with "react-native-track-player"
Aug 16, 2020
Hi @robertfernanV and @Rapsssito Will Apple reject this because we are using the dirty trick to "trick" Apple device? |
@ntvinhit, this will indeed result in a rejection if audio is not necessary for the app. However, the question is about an example code with "react-native-track-player", use it at your own risk. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Thanks for this great library! You comment about of "react-native-track-player", but i dont see any example with this two library together. do you have idea how implement? Thanks
Originally posted by @robertfernanV in #8 (comment)
The text was updated successfully, but these errors were encountered: