-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The plugin not working in iOS real device after setting up 15 mins interval. #464
Comments
@christocracy I have downloaded the repo and installed the FetchDemo app in my iPhone through Xcode and I could see UI that the app can show all the events that will be triggered in killed state and should be displayed whenever I will open the app letter. but so far no events I could see. |
same here,. so not working on real ios device |
help me please. |
In the README are instructions on how to simulate iOS fetch events. That's all you need to do to know that the plugin works. iOS can take days before their machine learning algorithm begins firing regular events. The best thing you can do to ensure events begin firing is to periodically open the app, to simulate real human behaviour. Also note the iOS does NOT fire fetch events after app terminate (there is no such thing as |
@christocracy Yet another question to avoid a new issue creating (it's related to this topic): |
that uses the old, deprecated iOS api. Don’t use that anymore. |
Your Environment
react-native -v
): 0.72.4Expected Behaviour
The plugin should trigger notification after every 15 mins when app is killed.
Actual Behaviour
Not getting triggered even single time.
Steps to Reproduce
const initBackgroundFetch = async () => {
const status = await BackgroundFetch.configure(
{
minimumFetchInterval: 15,
stopOnTerminate: false,
enableHeadless: true,
startOnBoot: true,
},
handleTask,
onTimeout
);
BackgroundFetch.start().then((value) => console.log(value, 'ok'));
};
// handleTask is called periodically when RNBF triggers an event
const handleTask = async (taskId) => {
console.log('nops');
triggerNotification();
BackgroundFetch.finish(taskId);
};
const triggerNotification = () => {
const time = DateTime.now().plus({ seconds: 60 });
const jsDate = DateTime.now().set({
hour: time.get('hour'),
minute: time.get('minute'),
});
console.log(jsDate.toMillis(), 'jsDate.toMillis()');
const trigger = {
type: TriggerType.TIMESTAMP,
timestamp: jsDate.toMillis(),
alarmManager: {
allowWhileIdle: true,
},
};
notifee.createTriggerNotification(
{
id: v4(),
title: 'test',
body: 'opps',
data: {
type: 'task',
id: 'nope',
},
ios: {
sound: 'default',
categoryId: 'done',
},
},
trigger
);
};
const onTimeout = async () => {
// The timeout function is called when the OS signals that the task has reached its maximum execution time.
// ADD CLEANUP WORK HERE (IF NEEDED)
BackgroundFetch.finish(taskId);
};
initBackgroundFetch() // calling the function here
Context
I was trying to trigger notification every 15 mins
Debug logs
2023-09-16 12:14:00.916686+0530 myiOSApp[29397:1314042] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 95 named com.apple.commcenter.coretelephony.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 95 named com.apple.commcenter.coretelephony.xpc was invalidated from this process.}
2023-09-16 12:14:00.938540+0530 myiOSApp[29397:1314037] 10.14.0 - [I-ACS025027] Deferring to Google Analytics for Firebase for event data collection. https://goo.gl/YNbdK2
2023-09-16 12:14:00.961875+0530 myiOSApp[29397:1314047] [javascript] Running "myiOSApp
2023-09-16 12:14:00.992622+0530 myiOSApp[29397:1314047] [javascript] 1694846700992, 'jsDate.toMillis()'
2023-09-16 12:14:01.038791+0530 myiOSApp[29397:1313806] [TSBackgroundFetch scheduleBGAppRefresh] com.transistorsoft.fetch
2023-09-16 12:14:01.078182+0530 myiOSApp[29397:1314047] [javascript] iosStoreURL is not set.
2023-09-16 12:14:01.118963+0530 myiOSApp[29397:1313806] To get test ads on this device, set:
Objective-C
GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @"1ae1bc50e874a825f4fdd7e4120a5c60" ];
Swift
GADMobileAds.sharedInstance().requestConfiguration.testDeviceIdentifiers = [ "1ae1bc50e874a825f4fdd7e4120a5c60" ]
2023-09-16 12:14:01.249680+0530 myiOSApp[29397:1313806] [TSBackgroundFetch start] (null)
2023-09-16 12:14:01.250944+0530 myiOSApp[29397:1314047] [javascript] 2, 'ok'
2023-09-16 12:14:01.373245+0530 myiOSApp[29397:1314046] [quic] quic_crypto_session_state_serialize [C1.1.1.1:2] [-ef6b0ba9525f4045] TLS ticket does not fit (6927 > 6144)
2023-09-16 12:14:01.373386+0530 myiOSApp[29397:1314046] [quic] quic_crypto_session_state_serialize [C1.1.1.1:2] [-ef6b0ba9525f4045] TLS ticket does not fit (6927 > 6144)
2023-09-16 12:14:29.731285+0530 myiOSApp[29397:1314045] [connection] nw_connection_add_timestamp_locked_on_nw_queue [C1] Hit maximum timestamp count, will start dropping events
2023-09-16 12:14:29.734747+0530 myiOSApp[29397:1314045] [connection] nw_connection_add_timestamp_locked_on_nw_queue [C3] Hit maximum timestamp count, will start dropping events
2023-09-16 12:15:14.993123+0530 myiOSApp[29397:1313806] [TSBackgroundFetch onAppTerminate]
The text was updated successfully, but these errors were encountered: