Closed pid0r-3blan closed 3 months ago
Are you testing fetch tasks by simulating events, as documented in the readme?
Why not try it and see?
Thanks for the quick reply. I understand testing is important, but it's quite time-consuming to test every scenario on two devices (iOS + Android). A basic theoretical understanding would really help me start off on the right foot.
But you're right, better to know how this works on practice. Thanks for the advice!
triggered from a background
The plug-in includes the word "background" in its name. This is on-purpose.
I'm currently working with your library and have some questions regarding the lifecycle of JavaScript background tasks, particularly in scenarios involving background or suspended states (e.g., when background geolocation or similar method wakes up the app from suspended state).
My primary concern is about the behavior of the
onEvent
JS callback. Specifically, I'm curious if the code located inindex.js
of the application gets executed when theonEvent
callback is triggered from a background or suspended state. In myindex.js
, I have essential initializations like service initialization, session restoration from async or encrypted storage, andregisterAppLaunchedListener
for navigation which includes further initialization, creation of an axios instance, etc.My question is: If I require an initialized axios with a session in the
onEvent
callback, should I replicate all these initialization tasks within theonEvent
function, or is it sufficient that the initialization is done inindex.js
?I understand this might depend on the platform (iOS/Android) and configuration (e.g., use of headless JS in Android), but I'm a bit unclear about how JS operates in such application states, and it's quite perplexing. Could you provide some insights on this, or recommend any resources for further reading?