That tutorial does not discuss about renew a subscription. The reason I added 2 additional functions to check existing subscription and remove the subscription was explained in the tutorial (don't want to have many pending subscriptions while rerun app too often to test).
Basically, the SDK support PubNub notification and it expires after 15 minutes. That's why the SDK was implemented to refresh the notification more frequently.
You said "disconnection from RingCentral server", do you mean the app/user logout or terminate the app? Anyway, you can call the platform.logout() to log out deliberately.
If you want to check if your app is still logged in (meaning the access token is still valid) you can call platform.loggedIn() which returns true or false accordingly. If it returns false, then call platform.login() to login again. If it is true, you are good to call any APIs.
If you app suppose to run for weeks or months continuously, I recommend to use Webhooks notifications instead of PubNub notification. Check this quick start to learn more about RingCentral Webhooks.