When I am using BackHandler.exitApp()
to close the app and not removing the app from task manager window of the android, when I am again opening the app, it seems before it starts the service init, it start to call service functions.
So as a result, I am doing init of this.db = new Datastore({ filename: dbPath, autoload: true, ...options });
, But before it happens the database service is already trying to use this.db
, so, as a result, it is saying this.db
as undefined
.
Can anyone tell me how can I do the init first and then start the services everytime I open the app? Or how can I exit a react native app with completely kill all the tasks?