How to send a test push notification to my web browser?
You can add a test device and target it from the dashboard to ensure your notification is displayed correctly.
Batch allows you to find information on your installation and test your integration or make sure the notification you are editing works as expected on desktop or mobile.
The easiest way is to use either your Installation ID if it is displayed in your app, your Custom ID if it is sent to Batch, or the email address linked to the profile if there is one. Once you retrieve your ID, go to point 2.
Locate your Installation ID
There are two ways to locate your installation ID on the web.
Through the search bar
Simply write javascript: in the URL bar of your website and copy and paste the following code:
batchSDK('ui.showPublicIdentifiers')

Through the Inspect window
Open your website, right-click somewhere on the page and select Inspect or Inspect Element in the context menu that appears.
Once you have the developer tools open, click the Console tab, paste the following code:
For both methods, Batch's SDK will then return your identifiers:

Ensure that:
Subscribed to notifications? is set to Yes
The Registration token field is not empty
💡 If these conditions are not fulfilled, or if you do not see the identifiers pop-in, try resetting your browser opt-in preferences (follow this guide: How can I reset my browser opt-in preferences?) and take this guide back to step 1.
Send a test notification
You can send a test notification from 3 different places:
a) From the debug tool
In case you just need to test your integration, you can use the Send test push button, and Batch will send a generic message with an image to your device.

b) From the list of registered test devices
You can see the list of all of the registered test deices from Settings > Push Settings. This is helpful to check if the token of your saved devices is still valid, and delete them if it's not the case:

c) From the campaign editor
You can send test notifications to your device to see how your campaign looks from the campaign editor.
Click on Send a Test and add your Installation ID or Custom ID in the corresponding field, then hit Send test.

Click ⚙️ to select your device in the saved devices, or copy your Installation ID in the corresponding field. Hit Send a test:

Locate your installation in your browser console
Alternatively, you can retrieve your Installation ID thanks to the console in the browser you are using.
a. Chrome
Right-click anywhere on your website, then click Inspect.

Then click on the Application tab and go to IndexedDB > BatchWebPush > BatchKVData

You should then be able to get your Installation ID, for example here: 1bb71252-2b58-4285-9fe0-321c37ce5730.
b. Firefox
Right-click anywhere on your website, then click Inspect Element.

Go to Storage > Indexed DB > Your Website URL > BatchKVData

Your installation ID is displayed on the first line, for example here: 61b11de8-5cc9-454f-a0b3-162f740b53a.
c. Safari
Right-click anywhere on your website, then click Inspect Element.

Then click on the Storage tab and go to Indexed Databases > BatchWebPush > BatchKVData.

You should then be able to get your Installation ID, for example here: ebccf486-961f-403e-97a3-39daf001f98c.
Last updated
Was this helpful?