react-native-workers
react-native-workers copied to clipboard
API call not working inside worker js file
var obj = {method:'POST'} fetch('http://localhost:3000/',obj).then(function(){ self.postMessage("check"); })
@jitenderchand1 Hard to help with no detail, but here are some things to check:
- Are you sure you mean
localhost
? This would mean that you want to access port 3000 on the device - If this is android and you are running your http server on your machine, have you used
adb reverse tcp:3000 tcp:3000
to make it available on the device?