How to test the integration on iOS?
Follow this guide to make sure Batch's SDK is integrated correctly before releasing your app to the AppStore.
There are several points you should check to make sure you will be able to use Batch at its full potential:
1. SDK version & production environment
SDK version
First and foremost, make sure you are using the latest version of Batch SDK by checking our iOS changelog.
Use the right SDK API key
Ensure you have selected the SDK API key that corresponds to the right environment (e.g., staging, dev, prod, etc.).
Make sure you switch to the SDK API key of your production environment before releasing a new version of your app to the store.
Find the right SDK API key from Batch's dashboard > Settings > General and change it in your code.
2. Rich push notifications support
What are rich push notifications?
From iOS 10, you can attach custom content to your notification, such as an image, a video, a sound file, or even a fully custom view controller.
How to test the integration?
Send a notification to your device to test your rich push notification integration.
Don't know how to send a test notification to your device? Follow the steps described in our guide: How to send a test push to my iOS device?
If you send the test push from the debug tool (Settings > Debug), an image should appear on the right side of the push notification, like below:
How to fix the issue?
Due to the way rich push notifications are implemented, you will need to integrate an additional SDK into your app to support that feature (Rich notifications setup).
3. In-App messages display
What are In-App messages?
In-App messages are messages displayed inside your app. You can trigger an In-App message when users open your app, perform a specific action, or as a landing page after opening a push notification.
How to test the integration?
Go to Settings > Themes. Pick a theme or create a new one. Select your device token, then click the "Preview" button.
The In-App message should be displayed correctly, ideally after your splash screen:

How to fix the issue?
Batch's SDK tries to display the In-App message as soon as possible. This can cause display issues as other elements of the app (e.g., ad, loader, splash screen, etc) may close the In-App message or prevent Batch's SDK from displaying it.
You can avoid these issues by using the "Do Not Disturb" (DnD) mode. It allows you to tell Batch to hold on to a mobile landing for you and resume the In-App display once the app is fully loaded. You will find more information here: DnD mode.
4. Direct opens detection
Each time a push notification is opened directly, the Batch SDK must report a push open event.
Read more on how to test direct opens detection in our dedicated guide: Why are my "direct opens" stuck at 0?.
5. Opt-in request to display notifications
A system prompt should be displayed to users to allow them to opt in (or not) to receive push notifications.
We recommend that you display this as early in the user journey as possible (ideally during the user's 1st session after installation) to maximise opt-in collection.
See how to do it in our Requesting the notification permission documentation.
6. Deeplinks
You can use deeplinks in your campaigns to direct users to a specific location in your application (for example: myapp://path/to/content).
To test if deeplinks are working, send a test notification to your device including a deeplink, and ensure that you are redirected to the expected page of your app after tapping the notification.
If the redirection is not working, refer to our dedicated guide: How to direct users to a page on my app?.
7. Avoid conflicts with Firebase
A warning message may appear in the logs when the app is started if a conflict with Firebase is detected.
This can cause issues with Batch's handling of notifications: the detection of direct opens, the processing of deeplinks and the display of In-App and Mobile Landings may not work.
Refer to our guide on how to prevent Firebase from intercepting Batch push notifications.
8. Custom data collection
What kind of custom data can I collect from the SDK?
In addition to the data the SDK collects natively, you can collect additional data to improve your segmentation, personalize your messages or trigger In-App messages.
Batch allows you to:
Send a unique user ID (Custom user ID).
Collect user data (e.g. attributes or tags) and track user actions (e.g. events).
How to test the integration?
Use the profile view (Profile → Search profiles) to find your most recent install, based on:
An Installation ID, which is an anonymous ID generated by Batch.
A custom user ID which should be the unique user ID you are sending to Batch from the SDK.


The debug tool shows all the native and custom data we have on your most recent installs:
Custom ID: This field shouldn't be empty if you are sending it to Batch and are logged into the app. Make sure that ID disappears after your log out.
Push token: This field shouldn't be empty if you opted in for push notifications. Double-check your logs to see if the SDK gives you more information on the issue.
Attributes/events: Your attributes will appear in the left panel and events will appear in the right panel of the profile view. Make sure important attributes are sent to Batch in the right format (e.g. date, string, boolean, etc) and at the right moment (e.g. on the first start of the app and/or when a value changes etc). Events will appear as soon as you perform the tracked action in the app.
9. Data collection compliance
Data collection is triggered when the Batch SDK starts. You need to ensure that you have the necessary consent from your users for the data treatments that you implement.
Reach out to your legal team to determine how to handle these treatments in your specific case.
Once you have determined the mechanism you want to implement, refer to our guide on how to integrate Batch with your consent management platform.
🚧 Optional: Implement Batch debugger
The debug view is a UI with multiple debug features, allowing you to see the native and custom data attached to your installation. You can also see the list of In-App automation already stored on your device.

This is useful for development purposes and for internal uses only, especially if your team cannot use a Custom User ID to find their device in the Profile view and send test notifications to their device. The debugger should be presented modally.
Objective-C
Swift
🚧 Optional: Display the installation ID
To ease the debugging, our clients usually display the Installation ID somewhere in their app (e.g. on a page of the app settings, or include it in the contact default message).

You can retrieve the anonymous installation ID generated by Batch using that method:
Swift:
BatchUser.installationID()
Objective-C:
[BatchUser installationID]
It can safely be exposed to your end users, who can then give it back to you if they are experiencing push trouble with their app.
From version 1.18 of our SDK, Batch implements the "Find my installation" feature. Batch will copy the Installation ID to the clipboard when the application appears in the foreground 4 times within 20 seconds. Read more in our guide on how to find the Installation ID on iOS.
Last updated
Was this helpful?