Open
Description
I have successfully implemented the react-native-sync-adapter
and is working fine for the foreground and background sync. But the main issue is, I want to stop the sync interval task after single sync. I want to sync the data only once when user taps on the sync
button in the application. Can anyone help me how to achieve that?
I am registering the task like:
const TASK_ID = 'TASK_SYNC_ADAPTER';
AppRegistry.registerComponent(appName, () => SyncAdapterExample);
AppRegistry.registerCancellableHeadlessTask(
TASK_ID,
() => TestTask,
() => {},
);
And canceling the task after my operation has been completed in TestTask.js
file like:
const TASK_ID = 'TASK_SYNC_ADAPTER';
AppRegistry.cancelHeadlessTask(TASK_ID, TASK_ID);
But I am getting an error while canceling the task:
TypeError: taskCancelProvider() is not a function. (In 'taskCancelProvider()()', 'taskCancelProvider()' is undefined)
Metadata
Metadata
Assignees
Labels
No labels