Skip to main content
All CollectionsGetting startedTesting the implementation
How can I test the integration on iOS?
How can I test the integration on iOS?

Follow this guide to make sure Batch's SDK is integrated correctly before going live on the AppStore.

Claire avatar
Written by Claire
Updated over a month ago

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?

Simply 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 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 (more information here).

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 landing pages after opening a push notification.

How to test the integration?

Go to Settings > Themes. Pick a theme or create a new one (more information here). 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. 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, personalise your messages or trigger In-App messages.

Batch allows you to:

How to test the integration?

Use the debug tool (Settings → Debug) 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 and events will appear in the right panel of the debug tool. 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.

  • Last location: In case you share with Batch the most recent location of your user, you should see a latitude/longitude in the right panel of the debug tool.

🚧 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 campaigns already stored on your device.

This is useful for development purposes and for internal uses only, especially if your team cannot use an advertising or a custom user id to find their device in the debug tool and send test notifications to their device. The debugger should be presented modally.

Objective-C

UIViewController *debugVC = [Batch debugViewController]; if (debugVC) { [self presentViewController:debugVC animated:YES completion:nil]; }

Swift

if let debugVC = Batch.debugViewController() { present(debugVC, animated: true, completion: nil) }

🚧 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: BatchUser.installationID() (Swift) / [BatchUser installationID] (Objective C). 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.

👉 Need more help?

If you have any questions, don't hesitate to ping us at support@batch.com, or directly on the live chat!


This article belongs to Batch's FAQ. Need more help? Find insightful articles, documentation, case & market studies, guides, and even more in our website's Resources section on batch.com and our blog.

Did this answer your question?