Skip to content

Commit 22b9afe

Browse files
authored
Log Braze impression when presenting a Judo IAM (#1)
As per the Braze [documentation for custom In-App Messaging UIs](https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/in-app_messaging/customization/#logging-impressions-and-clicks) (that replace the stock Braze one), such custom UIs are responsible for calling Braze's impression log routine. This was neglected in the initial implementation of the module.
1 parent 678addc commit 22b9afe

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Sample/Judo Braze Demo App/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, ABKInAppMessageController
4747
}
4848

4949
@IBAction func buttonClicked(_ sender: Any) {
50-
// Fire a Braze Event. If you have an appropriate campaign set up in your Braze settings for this event to open an IAP with the `judo-experience` extra field added, then this should open the Experience.
50+
// Fire a Braze Event. If you have an appropriate campaign set up in your Braze settings for this event to open an IAM with the `judo-experience` extra field added, then this should open the Experience.
5151
Appboy.sharedInstance()?.logCustomEvent("My Test Event")
5252
}
5353

Sources/Judo-Braze/Judo_Braze.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ private var observerChit: NSObjectProtocol!
88
public extension Judo {
99
/// Call this method to automatically track Judo events into Braze.
1010
///
11-
/// Note to enable IAP integration there is further work to do, please see the documentation included with this module.
11+
/// Note to enable IAM integration there is further work to do, please see the documentation included with this module.
1212
func integrateWithBraze() {
1313
if #available(iOS 13.0, *) {
1414
observerChit = NotificationCenter.default.addObserver(
@@ -31,13 +31,14 @@ public extension Judo {
3131
}
3232
}
3333

34-
/// This method a helper for launching Judo Experiences when a `judo-experience` extra is added to a Braze In-App message, which you can use from a `ABKInAppMessageControllerDelegate`. See the documentation included with this module for more details.
34+
/// This method a helper for launching Judo Experiences when a `judo-experience` extra is added to a Braze In-App Message, which you can use from a `ABKInAppMessageControllerDelegate`. See the documentation included with this module for more details.
3535
func brazeBeforeInAppMessageDisplayed(inAppMessageDisplayed inAppMessage: ABKInAppMessage) -> ABKInAppMessageDisplayChoice? {
3636
// https://www.braze.com/docs/developer_guide/platform_integration_guides/ios/in-app_messaging/implementation_guide/#custom-slideup-in-app-message
3737

3838
if let urlString = inAppMessage.extras?["judo-experience"] as? String, let experienceURL = URL(string: urlString) {
3939
Judo.sharedInstance.openURL(experienceURL, animated: true)
40-
// Since we are doing our own behaviour, inhibit Braze's built-in IAP UI from displaying anything.
40+
inAppMessage.logInAppMessageImpression()
41+
// Since we are doing our own behaviour, inhibit Braze's built-in IAM UI from displaying anything.
4142
return ABKInAppMessageDisplayChoice.discardInAppMessage
4243
}
4344
return nil

0 commit comments

Comments
 (0)