CaliStyle / ng-intercom

Angular 7+ Wrapper for Intercom.com
MIT License
54 stars 46 forks source link

boot not working after shutdown #66

Closed dottodot closed 6 years ago

dottodot commented 6 years ago

I think this is a general issue with boot as it seems like it's not possible the use boot more than once.

This means if I want to use shutdown and then boot like below it doesn't work.

    this.intercom.shutdown();
    this.intercom.boot({
      app_id: environment.intercom,
      custom_launcher_selector: '#custom-intercom',
      alignment: 'left',
      hide_default_launcher: true
    });

I believe the issue is is due to the loadIntercom function as the callback isn't used after

     ic('reattach_activator')
     ic('update', config)
ghost commented 6 years ago

same here

wbhob commented 6 years ago

I attempted a fix in #68. Turns out you were spot on. Scott is going to review these PRs tomorrow, and I'll likely publish as soon as it's merged. Thanks for your patience!

ghost commented 6 years ago

nice

naeem-gitonga commented 5 years ago

I am still seeing this issue. After shutdown ng-intercom will not boot and will remove the message widget. please help.

wbhob commented 5 years ago

Are you on the latest version?

naeem-gitonga commented 5 years ago

Are you on the latest version?

Yes, 8.0.0

wbhob commented 5 years ago

Do you have platform/browser information? I can't really debug this issue because you haven't told me how to reproduce it. .

naeem-gitonga commented 5 years ago

Do you have platform/browser information? I can't really debug this issue because you haven't told me how to reproduce it. .

Sure, thanks! We are using Angular 8, the latest version of chrome. When I use the shutdown method (right before logout), it will make the intercom icon disappear from my login page, and it will not reappear on its own. In order to bring it back I would have to refresh the page or log back into my app.

wbhob commented 5 years ago

Ok, so what you'll want to do in this case is immediately after shutdown, call boot() again, but without user data passed in. Then, when the user logs back in, call shutdown again, and boot again with the user data. If the app is refreshed, it will show up with out a user by default, so you don't have to do anything there.

More info: https://www.intercom.com/help/en/articles/16845-how-do-i-end-a-session

naeem-gitonga commented 5 years ago

@wbhob Thanks!