I am working on a Xamarin Forms application that allows you to submit Orders.
An order is composed with one ore multiple items, and an item can have many pictures.
To submit an Order to the server, these are the steps:
The submission of the Order is working fine, but I have a use case were if there is no internet connection, the Orders enters in a "Pending to Submit" status, and when the device gets online again, it will automatically submit all the Orders with "Pending to Submit" status.
To do this, I have subscribed to the ConnectivityChanged event of the Xamarin Essentials Connectivity plugin, and when I detect that user has internet access, I start submitting each Order at a time. I don't know if there is a better solution to do this.
Also, there is a posibility that in the middle of a submission internet goes offline again, so maybe an Order was created, but the list of items are stuck in the middle without internet and the whole operation gets corrupted.