The community forums are in BETA and closed to the public.

JS API - Disconnecting

When the internet is disconnected, is it recommended to stop the mobile Pubsub from sending 'ping' requests to the server?

How do we do this with the JS SDK?

Hey Dewi,

Who recommends this? If you'd like to unsubscribe using the javsacript SDK, you can use pubnub.unsubscribe().

The internet is disconnected, so unsubscribe would not work properly?

There should be no need to do anything at all. The SDK should get a disconnect callback and should not be sending any further pings until a reconnect callback is invoked and the SDK and your client are back online.

Perhaps you can provide further details about the issue you are having?

Hi Craig, I tested the JS library by initializing, subscribing, and then disconnecting the internet. When I disconnect the pubnub requests continues with a failed status until I reconnect the internet. It doesn't stop trying.

Example URL requested:

Login or Signup to post a comment