Question:
How do I check if the Pushwoosh Web SDK has been integrated correctly?
Answer:
1. Check that the SDK is on the page. Open DevTools → Elements, search for pushwoosh, and confirm there are two entries: the script that loads the Web SDK and the script (or module import) that initializes it.
2. Check the init parameters. A correct Web SDK 3.x initialization must contain:
-
applicationCode- your Pushwoosh application code; -
apiToken- a Device API token that has access to that application. Since Web SDK 3.x this parameter is mandatory; without it the SDK cannot register the browser and you will typically see 401 errors; -
safariWebsitePushID- required only if you target Safari; -
serviceWorkerUrl- required only ifpushwoosh-service-worker.jsis not in the site root.
Double-check these values for typos - a wrong applicationCode or an apiToken that lacks access to the application is the most common integration mistake.
3. Check that the service worker is reachable. Open https://your-domain.com/pushwoosh-service-worker.js in the browser - it must be publicly available and served from your own HTTPS domain. Then open DevTools → Application → Service Workers and confirm the worker is registered and activated for the expected scope.
4. Check that the device actually registers. Open DevTools → Network, reload the page and grant the notification permission. You should see Pushwoosh Device API calls such as /registerDevice (and /setTags, if you set tags) returning status_code: 200. If those calls appear and succeed, the integration works and the subscriber shows up in your Pushwoosh application.
Note: a manifest.json (or pushwoosh-manifest.json) link in the <head> was required by older, GCM-era versions of the Web SDK. Web SDK 3.x uses VAPID and needs only pushwoosh-service-worker.js, so a missing manifest is no longer an integration error.
See Web push SDK 3.0 for the full integration reference.
Comments
0 comments
Please sign in to leave a comment.