When integrating the Pushwoosh Web SDK using the NPM package, the subscription widget (PWSubscribePopupWidget) is not initialized automatically by default. You must explicitly import and run the widget after the main SDK initialization.
To resolve this, add the following code snippet after your init call:
import { Pushwoosh, PWSubscribePopupWidget } from 'pushwoosh-web-notifications';
// ... Main SDK initialization code ...
pushwoosh.push(async () => {
try {
const widget = new PWSubscribePopupWidget(pushwoosh);
await widget.run();
} catch (error) {
console.error('PWSubscribePopupWidget initialization failed:', error);
}
});
This ensures the custom subscription prompt is triggered correctly.
Comments
0 comments
Please sign in to leave a comment.