I'm lokking for some better idea to sync my ios-messenger-app with the b4j-server. Under IOs, we have the following problem: In most cases, the user starts the app over the app-icon instead over the notification. The next point is, that under IOs only the last push-message is saved by the push-service, when the app is not reachable for some time and IOs did not process the message when the app is in background. Now it is required to sync the app with the server to load all the messages, which are not delivered. So far, the server holds a map with a minimum informations about each message. When the client starts, it downloads the map, looks if the message was delivered or not and if not, the client creates the message and sends back a timestamp to the server, that the server knows, which message was delivererd successful. In that case, the sever deletes this messeges from the map. This runs good, if there is a good internet-connection.
The problem is, if there is a bad internet connection and the last push will arrive. When the user starts the app over the app-icon, the client tries to download the map with the undelivered messages. In areas with bad network coverage, the synchronisation takes to long time or fails and has to start from the beginning. That leads to confusin by the user because of the time warp.
How does WhatsApp and Threema do that? When swichting off the internet connection and sends a lot of messages to the client, it seems, that all the messages are part of only one push-message. A lot of messages will arrive in fractions of a second even if the internet coverage is bad.
Does anybody have a solution for this behavior?
Under android i did not have such problems because the push-service saves up to 100 messeges for each device and the app could process each message in the background.
I'm thankful for every idea...
The problem is, if there is a bad internet connection and the last push will arrive. When the user starts the app over the app-icon, the client tries to download the map with the undelivered messages. In areas with bad network coverage, the synchronisation takes to long time or fails and has to start from the beginning. That leads to confusin by the user because of the time warp.
How does WhatsApp and Threema do that? When swichting off the internet connection and sends a lot of messages to the client, it seems, that all the messages are part of only one push-message. A lot of messages will arrive in fractions of a second even if the internet coverage is bad.
Does anybody have a solution for this behavior?
Under android i did not have such problems because the push-service saves up to 100 messeges for each device and the app could process each message in the background.
I'm thankful for every idea...