Hi,
Thanks for writing to us.
When sendPushMessage is called in App42 SDK, it is queued for delivery on App42 server. App42 Server then sends this message to APNS/GCM/MPNS platform service provider. After that it is send to device from respective platform service provider. If device is online, it will get delivered, if it is offline, it will be delivered once it comes online.
Also, there is no guarantee of delivery by any platform service provider (GCM/APNS/MPNS) in this case and it is based on best effort.
If you want spontaneous and in real-time messaging, you can use Storage service to store the message, and apply continuous poll on it from your app. You can combine this with Push notification that will help you in taking your app back to wake up state if it is not opened at the time of message delivery.
Also, you can check the Push Logs in AppHQ consoled available under Push Notification tab to know the delivery status to APNS/GCM/MPNS server from App42 side.
Alternatively, you can also opt to use AppWarp to make a real time message application.
Let me know if it makes sense.
Thanks.