How to disconnect NotificationChannel

Hi,

My Aplication call bellow two method for disconnect NotificationChannel.

  • NotificationHandler.RemoveAllSubscriptions();
  • NotificationHandler.disconnect();

And after 60 seconds, call bellow method for disconnect check.

  • NotificationsApi.headNotificationsChannel(String channelId);

I expect response code 404, However code is 200 OK. Is it still keeping the connection alive?
headNotificationsChannel() after 120 seconds and got the same result(200 OK).

If the disconnection procedure above is incorrect, what method should I follow to disconnect correctly?
SDK Version is platform-client-v2:134

Regards,

Hi. You're doing it correctly. Channels are long-lived objects and will persist after disconnection. A channel will remain open for 24 hours before closing automatically, and at that point you can expect a 404 response code.

It should also be noted that you have a limit of 20 channels per user/app combination, but that will be noticeable only if you have active connections in 20 channels. If you already have 20 channels, then any new channels you create will replace the oldest channels, starting with channels that do not have any active connections. As long as you are you are disconnecting from older channels as you have shown, those channels will be the ones to get replaced and won't affect your limit.

We don't offer a method for explicitly deleting a channel.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.