jamesisaac / react-native-background-task

Periodic background tasks for React Native apps, cross-platform (iOS and Android), which run even when the app is closed.
MIT License
1.1k stars 111 forks source link

Background service is not working #85

Open donny08 opened 3 years ago

donny08 commented 3 years ago

I have setup a task to run when application goes background. Unfortunately, its not working for me. Please find the below code

import BackgroundTask from 'react-native-background-task'
import { Vibration } from 'react-native';

BackgroundTask.define(() => {
  Vibration.vibrate(3000);
  BackgroundTask.finish()
});

const App = () => {
    React.useEffect(() => {
       BackgroundTask.schedule({ period: 60 }); 
    });
}

Any help on this.

mosishon commented 3 years ago

same issue here

Jefferson-Bueno-Da-Silva commented 3 years ago

here too

Raniakhalifa commented 3 years ago

same issue , any updates?

titanve commented 3 years ago

I think that the 'issue' is that this package is not maintained anymore.

vestronv commented 2 years ago

@donny08 I think you can't update every 1 minute(as you have givenperiod: 60) minimum time required is 15 minutes ie. period : 900

corasphinx commented 2 years ago

It's too difficult to use react-native-background-task for iOS. It doesn't work absolutely. Never!

corasphinx commented 2 years ago

@vestronv Does it work on your end?

tgreco commented 2 years ago

It is not working for me on Android.

afzalali27 commented 2 years ago

Not work at all. even crashing the build on first launch

ZohaibAhmad786 commented 1 year ago

not working at all, i have assigned period time to 900 but still same.

h1nson commented 3 months ago

welcome join the club.