Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with subscribing after unsubscribeAll() #38

Open
sunu-xminds opened this issue Feb 9, 2020 · 0 comments
Open

Issue with subscribing after unsubscribeAll() #38

sunu-xminds opened this issue Feb 9, 2020 · 0 comments

Comments

@sunu-xminds
Copy link

sunu-xminds commented Feb 9, 2020

The initial subscription works fine for me in my use case. But in my application when a person logs out I have to unsubscribe all the subscriptions, for which I used unsubscribeAll() method. When the person logs in again, I am again calling the subscribe method to, get the listeners live. But its not working.

initListener(user) {
    const channel = `chanelName`;
    this.pubnub.subscribe({
      channels: [channel],
      withPresence: true,
      autoload: 100,
      triggerEvents: ["message", "presence", "status"]
    });
    const history = this.pubnub.getMessage(
      channel,
      this.handleMessageReceived.bind(this)
    );
  }

This is how I subscribe to channel and
this.pubnub.unsubscribeAll(); this is how I unsubscribe everything.

Am I doing something wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant