Skip to content

Background service is not working #85

@donny08

Description

@donny08

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions