Skip to content

How use custom link button after initialize OneSignal? #535

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

Open
ayozebarrera opened this issue Aug 5, 2019 · 7 comments
Open

How use custom link button after initialize OneSignal? #535

ayozebarrera opened this issue Aug 5, 2019 · 7 comments

Comments

@ayozebarrera
Copy link

Description:

Hi, I'm using a React app and I have a component called Settings that initialize OneSignal and renders the custom link button. And It works perfect!
But If I use another component, the button will be "destroyed", and If I try to load Settings again, the custom link button won't appear... how can I achieve this?

Thanks for the help

Steps to Reproduce Issue:

  1. Initialize OneSignal with the custom link button on the dom
  2. Remove the custom link button of the dom
  3. Insert the custom link button again
@rgomezp
Copy link
Contributor

rgomezp commented Aug 5, 2019

But If I use another component, the button will be "destroyed", and If I try to load Settings again, the custom link button won't appear... how can I achieve this?

What do you mean here? What other component are you using?

@ayozebarrera
Copy link
Author

ayozebarrera commented Aug 6, 2019

Oh, I mean that if the button is unloaded from the dom, and then loaded again, the button won't work because OneSignal was already initialized

@rgomezp
Copy link
Contributor

rgomezp commented Aug 12, 2019

I see. If you add the css class "onesignal-customlink-container" the button should work. Instead of unmounting the component, you could try toggling its visibility.

@ayozebarrera
Copy link
Author

ayozebarrera commented Aug 12, 2019 via email

@rgomezp
Copy link
Contributor

rgomezp commented Aug 12, 2019

I'll mark this as a feature request. Cheers!

@rgomezp rgomezp closed this as completed Aug 12, 2019
@theigl
Copy link

theigl commented May 6, 2020

@rgomezp: I'm very interested in this feature as well.

Is there currently any way to achieve this? Or is it somehow possible to completely destroy the OneSignal SDK and re-initialize it after the the element is re-added to the DOM?

@TimothyStulens
Copy link

Why is this marked as "Closed" if there is no solution given?

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

No branches or pull requests

4 participants