The heartbeat interval is a mechanism that ensures the background connection to our servers is kept active while your app runs in the background. Increasing the frequency of the keepalive interval will have an adverse affect on battery life and network bandwidth utilization, whereas decreasing the frequency may impact immediate notification delivery, and cause some networking hardware to passively disconnect your app's idle connection to Pushy.
You may increase or decrease the default 5 minute (300 second) socket keep-alive interval by adding the following line of code before
Pushy.listen(Context) in your main launcher activity:
Pushy.setHeartbeatInterval(int seconds, getApplicationContext());
Note: The heartbeat interval must be greater than or equal to
60 seconds, and cannot exceed
1800 seconds (30 minutes).
In addition, please call this method