Help with steps to detach and do background processing

#1

Hi,

Im currently developing an application that requires background processing. Basically, I do need to use socket.io to listen to events even after the app is not running in the fore ground.

I do understand that background processing is currently not supported in Expo and i would have to detach.

As such, I have already detached and my project runs fine on android studio. However, there are a few missing steps for me to get this working and I would like to ask for help.

  1. where to I register my background task function using this?
    AppRegistry.registerHeadlessTask(‘background task’, () => “background task”) ?

Since I am unable to update index.android.js (there is no index.android.js for me, “main” in “package.json” points to “./node_modules/react-native-scripts/build/bin/crna-entry.js”,

  1. How do I go about writing my “backgroundtask.js” ?
    the RN docs simply said to write this…

module.exports = async (taskData) => {
// do stuff
}

Thanks for any help provided! Been stuck at this for quite awhile…