You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You mention in your documentation react-native-track-player in order to be able to work correctly on iOS.
But I can't find an example of an implementation. I read this issue correctly but I think it is a bit incomplete.
I searched the internet a lot (especially in all github looking for the react-native-track-player package) without finding an answer.
If I use your example, how would you implement react-native-track-player ?
const taskRandom = async (taskData) => {
if (Platform.OS === 'ios') {
console.warn(
'This task will not keep your app alive in the background by itself, use other library like react-native-track-player that use audio,',
'geolocalization, etc. to keep your app alive in the background while you excute the JS from this library.'
);
}
await new Promise(async (resolve) => {
// For loop with a delay
const { delay } = taskData;
console.log(BackgroundJob.isRunning(), delay)
for (let i = 0; BackgroundJob.isRunning(); i++) {
console.log('Runned -> ', i);
await BackgroundJob.updateNotification({ taskDesc: 'Runned -> ' + i });
await sleep(delay);
}
});
};
Thanks you very much and sorry for my bad english, I'm french :)
The text was updated successfully, but these errors were encountered:
consttaskRandom=async(taskData)=>{if(Platform.OS==='ios'){console.warn('This task will not keep your app alive in the background by itself, use other library like react-native-track-player that use audio,','geolocalization, etc. to keep your app alive in the background while you excute the JS from this library.');}awaitnewPromise((resolve)=>{// Playing listenersconstlistenerChange=TrackPlayer.addEventListener('playback-state',(newState)=>{// Do stuffif(newState.state===TrackPlayer.STATE_PLAYING){// What to do when the play button is pressed}elseif(newState.state===TrackPlayer.STATE_PAUSED){// What to do when the pause button is pressed}});});};
@GaylordP, there is a lot more configuration needed for react-native-track-player to work. However, this is outside the scope of this library, you may want to ask this in their repository.
Hello :)
Thanks you very much for your library.
You mention in your documentation
react-native-track-player
in order to be able to work correctly on iOS.But I can't find an example of an implementation. I read this issue correctly but I think it is a bit incomplete.
I searched the internet a lot (especially in all github looking for the
react-native-track-player
package) without finding an answer.If I use your example, how would you implement
react-native-track-player
?Thanks you very much and sorry for my bad english, I'm french :)
The text was updated successfully, but these errors were encountered: