Batch allows you to find information on your installation and save your push token to send test notifications to your web browser.

This is useful to test your integration or make sure the notification you are editing looks as expected on desktop or mobile.

Here is how to proceed:

1. Locate your Installation ID

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:

"batchSDK"in window?window.batchSDK(function(a){a.getInstallationID().then(function(a){window.prompt("Here is your Batch Installation ID",a)})}):window.alert("Batch SDK is not running");


Batch's SDK will return your Installation ID:

2. Find information on your browser

On Batch's dashboard, go to Settings > Debug, paste your Installation ID to find your device token. Then click "Save as a test device" :

Note: Web push notifications do not work in incognito mode.

3. Sending 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 a test" button (see screenshot above). 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 the registered test devices from Settings > Push Settings. This is helpful to check if the token of your saved devices are still valid and delete them if it's not the case.

c) From the campaign editor

You can send test notifications to your a saved device or to a push token you already know from the message editor. Just click the ⚙️ to select your device and "Send a test".

4. Locate your installation in your browser console

First you will need to get 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 the "Application" tab and go to IndexedDB > BatchWebPush > BatchKVData

You should then be able to get your Installation ID, 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, example here: 61b11de8-5cc9-454f-a0b3-162f740b53a.

After you successfully retrieved your Installation ID, go to your Dashboard > Settings > Debug. Then select "Installation ID" and type your Installation ID, finally click on the debug button.

You should then be able to save this installation ID for future tests or simply send a push notification by clicking "Send test push".

Did this answer your question?