Skip to content
Andrew Clunis edited this page Sep 23, 2021 · 4 revisions

Judo-Braze iOS

You can use this library to facilitate integrating Judo with Braze, automatically tracking Judo Screen Views into Braze, and making it easy to launch Judo experiences as Braze IAM campaigns.

Installation

Ensure that you have both the Judo and Braze SDKs fully integrated and working before you continue.

To add the dependency to your project using Xcode (12 or later assumed), choose File -> Swift Packages -> Add Package Dependency, and type the URL to this repository into the search field:

https://github.com/judoapp/judo-braze-ios

Then, in your AppDelegate after you initialize both Judo and Braze, call the following:

import JudoSDK
import AppboyKit
import Judo_Braze

// in didFinishLaunchingWithOptions, after already initializing Judo and Braze individually, add:
Judo.sharedInstance.integrateWithBraze()

Event Tracking

This is automatic; once you call Judo.sharedInstance.integrateWithBraze(), this is configured for you. Look for the event Judo Screen Viewed appearing in Braze.

In-App Messaging Setup

Enabling Judo Experiences as Braze IAM messages takes little bit more setup. You'll need an ABKInAppMessageControllerDelegate set up. The integration works by inhibiting Braze's own IAM UI, and instead opening the Experience.

You'll need a little bit of boilerplate to set it up. First, if you don't already have one, create an object that conforms to ABKInAppMessageControllerDelegate, and add the following method to it:

func before(inAppMessageDisplayed inAppMessage: ABKInAppMessage) -> ABKInAppMessageDisplayChoice {
    return Judo.sharedInstance.brazeBeforeInAppMessageDisplayed(inAppMessageDisplayed: inAppMessage) ?? .displayInAppMessageNow
}

In-App Message Usage

Create a Braze IAM Campaign in the Braze web UI of the HTML Custom View type. Advance through each the below steps by clicking the "Forward" button in the bar at the very bottom of the display.

Creating an IAM Campaign

Braze Create Campaign Menu

Selecting "Custom Code" Message Type

While any of the Message Types should work, we suggest using the Custom Code type. You'll then need to populate the content of the Message with the minimum that Braze requires; note that this will not be shown on to the user, but Braze expects to use its own UI and so requires us to provide some content.

Braze Custom Code Campaign

With the Custom Code type, use the following minimal HTML snippet to satisfy the form validation: <a href="appboy://close">X</a>.

Braze HTML Snippet

Setting the judo-experience Extra

Then, set a custom Extra value on the Campaign with a key of judo-experience. Provide the URL of the Judo Experience you'd like to show here. This is what the Judo-Braze Integration Library will detect in the handler and use to inject your Judo Experience in lieu of the standard Braze IAM UI.

Braze Campaign Extras Configuration

Finishing the Campaign

You will need to complete the campaign, namely setting up a trigger for the Campaign and selecting users via Segments in the Delivery and Target User sections respectively. This is out of scope of this document, so please see Braze's Creating an In-App Message Guide.

Sample Project

In this repository, there is a Sample directory that contains an example Xcode project using the Judo-Braze integration module, useful for both reference and testing purposes.