angularhttpionic-frameworkcapacitorconnectivity

Ionic Capacitor strategy for http requests


I've an application with Capacitor 3, Ionic 5 and Angular. I'm using Capacitor Http plugin for all requests due to CORS problem in the server.

The application makes http requests against the server, but sometimes, when the quality of network is bad, the request hangs the device or fails and exit the app.

I can't implement a retry strategy, for example with Observables in angular, because I'm using the Capacitor Http plugin and not Angular HttpClient.

With Capacitor I can detect if the device is online (network connectivity) or it's offline, but not a poor connection.

Does anyone have experience with this situation and how to resolve it?

Regards J


Solution

  • I think you can try few things maybe its can help you for solve the problem.

    I hope these help you.