static fetchCall(request) {
    console.log('Request' + JSON.stringify(request))
    return fetch(AsynCall.BASE_URL, {
      method: 'POST',
      body: JSON.stringify(request),
    }).
    then((response) => 
        response.json())
        .then((responseData) =>
            ResponseController.handleResponse(responseData),
        ).then(res => {
          return res
        })
        .catch((error) => {  
          throw (error)
        },
        )
  }
}
On Android its working fine in background, But iOS gives error in background.
"code": "ENSURLERRORDOMAIN-1005" , "message": "Network connection was lost"
Thanks in Advance.
That's because react-native doesn't support background tasks out of the box. Consider using a third-party library, like react-native-background-fetch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With