Hi Saurabh,
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.
Alternatively, you can also opt to use AppWarp to make a real time message application.
Let me know if it makes sense.
Thanks
Ajay