transistorsoft / react-native-background-fetch

Periodic callbacks in the background for both IOS and Android
MIT License
1.43k stars 191 forks source link

App never received any Fetch event in iOS real device . #487

Closed Maharshsoni7 closed 2 months ago

Maharshsoni7 commented 2 months ago

Your Environment

Expected Behavior

Receive Event in 15 min expected

Actual Behavior

Never received any Fetch event.

Context

const startBackgroundProcess = async () => { console.log("call startBackgroundProcess"); let status = await BackgroundFetch.configure({ minimumFetchInterval: 15, // Minimum fetch interval in minutes stopOnTerminate: false, // Whether to stop background fetch on app termination startOnBoot: true, // Whether to start background fetch on device boot enableHeadless: true, }, onEvent, onTimeout); BackgroundFetch.scheduleTask({ taskId: "com.transistorsoft.MyCustomTaskId", forceAlarmManager: true, delay: 5000, // <-- milliseconds periodic: true, requiredNetworkType: BackgroundFetch.NETWORK_TYPE_ANY }); }

Debug logs

iOS: XCode logs: [TSBackgroundFetch scheduleProcessingTask]

christocracy commented 2 months ago

Be patient. It can take days before iOS machine-learning algorithm settles in and begins firing events.

Just bring the app to foreground periodically like normal user behaviour.

christocracy commented 2 months ago

If simulated events work, that's all you need to know.

Maharshsoni7 commented 2 months ago

Be patient. It can take days before iOS machine-learning algorithm settles in and begins firing events.

Just bring the app to foreground periodically like normal user behaviour.

Yes, Event triggers occur two to three hours later.