Skip to content

braze-inc/braze-growth-shares-ios-demo-app

Repository files navigation

A Braze SDK implementiation Swift iOS Application

Table of Contents

About Braze Demo

The focus of this application demonstrates how to decouple any dependencies on Appboy-iOS-SDKfrom the rest of your existing production code. One objective was for there to be only one import Appboy-iOS-SDK in the entire application.

All of the Braze-related dependencies are handled in the BrazeManager.swift file that the existing production code calls into.

In doing so, this project demonstrates the abilities of how custom objects can be represented as Content Cards.

In doing so, this project also demonstrates how to natively customize In-App Message with subclassed ABKInAppMessageViewControllers.

Content Cards

Objects can adopt the ContentCardable protocol which comes with the ContentCardData object and an initializer. Upon receiving an array of ABKContentCard objects from the SDK, the corresponding ABKContentCard objects are converted into a Dictionary of metadata that are used to instantiate your custom objects.

This demo highlights 4 Content Card use cases:

  1. Content Cards as Supplemental Content to an existing feed
  2. Content Cards as an Inline Ad Banner
  3. Content Cards as a Message Center
  4. Content Cards as an Interact-able View

Extra use cases:

  1. Content Cards that can be inserted/removed to/from an existing feed in real-time via silent push (device only)
  2. Content Cards that can be reordered in an existing feed in real-time via silent push (device only)

In-App Messages

Custom view controllers can represent in-app messages by subclassing ABKInAppMessageViewController. Due to the individusalitic nature of in-app messages, we can mix and match displaying custom in-app messages and default in-app messages.

This demo highlights 5 in-app message use cases:

  1. Slideup In-App Message with a modified resting point
  2. Modal In-App Message as a dynamic list
  3. Modal In-App Message as a native video player
  4. Full In-App Message as a Push Notifications primer with list of push tags
  5. Full In-App Message as an interactive App Tracking Transparency primer

Push Notifications

Custom interfaces can be added to Push Notifications with the help of Notification Content Extensions.

This demo highlight 3 Notification Content Extension use cases:

  1. Interactive Push Notification (Match Game)
  2. Personalized Push Notification (Braze LAB Progress)
  3. Information Capture Push Notification (Register Email)

Using the Project

  1. Replace "YOUR-API-KEY" with your Braze API key here
  2. Replace the Appboy/Endpoint value with your Appboy endpoint here
  3. Replace "YOUR-CONTENT-BLOCK-API-KEY" with your Braze Content Block API Key here
  4. For an API Triggered Campaign:
    • Replace "YOUR-CAMPAIGN-API-KEY" with your Braze campaign API key here
    • Replace "YOUR-CAMPAIGN-ID" with your Braze campaign ID here
  5. For Out-of-the-Box Content Cards:
    • Replace "YOUR-BANNER-CAMPAIGN-ID" with your Banner Campaign ID here
    • Replace "YOUR-CAPTIONED-IMAGE-CAMPAIGN-ID" with your Captioned Image Campaign ID here
    • Replace "YOUR-CLASSIC-CAMPAIGN-ID" with your Classic Campaign ID here