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

[Question]: How to init onesignal in a website #46

Open
marshall86 opened this issue Jul 4, 2024 · 1 comment
Open

[Question]: How to init onesignal in a website #46

marshall86 opened this issue Jul 4, 2024 · 1 comment

Comments

@marshall86
Copy link

How can we help?

What's wrong with this implementation?

import { OneSignal } from 'onesignal-ngx';
constructor(private oneSignal: OneSignal) {}

ngOnInit() {
if (this.oneSignal.Notifications.isPushSupported()) {
await this.oneSignal.init({ appId: this.onesignalAppId });
// this.oneSignal.User.PushSubscription.addEventListener('change', this.pushSubscriptionChangeListener);
}
}

I get this error:

TypeError: Converting circular structure to JSON --> starting at object with constructor '_' | property '_zoneDelegate' -> object with constructor 'l' --- property '_zone' closes the circle at JSON.stringify (<anonymous>) at stringify (Utils.js:46:21) at Array.map (<anonymous>) at d.logMethodCall (OneSignalUtils.js:41:55) at g (utils.js:51:12) at Vi.enqueue (OperationCache.js:6:9) at Qi.<anonymous> (ExecutorBase.js:91:32) at Generator.next (<anonymous>) at r (tslib.es6.js:118:58) at l.invoke (polyfills.bbe44d985996c9f8.js:1:18642)

@nan-li
Copy link

nan-li commented Nov 1, 2024

Hi @marshall86 apologies for the delayed response. Were you able to resolve this error?

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

2 participants