Swiftpack.co - thunderheadone/one-sdk-ios-test as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by thunderheadone.
thunderheadone/one-sdk-ios-test 6.1.8
Thunderhead iOS SDK for ONE and Interaction Studio repo used for alpha and beta releases
⭐️ 0
🕓 2 years ago
iOS
.package(url: "https://github.com/thunderheadone/one-sdk-ios-test.git", from: "6.1.8")

Thunderhead SDK

Resources

Table of Contents

For native integration, simply follow the steps outlined under the installation and configuration section to quickly integrate the SDK into your app.

Prerequisites

  • Install the following:

    • Xcode 12.0 or later

    • CocoaPods 1.10.0 or later

  • Make sure that your project meets these requirements:

    • Your project must target iOS 9 or later.
  • Set up a physical iOS device or use the iOS simulator to run your app.

Note:

  • Xcode versions < 12.5 only support archiving an application with bitcode disabled.

Step 1: Add the Thunderhead SDK to your app

We recommend using CocoaPods to install the Thunderhead SDK. However, if you'd rather not use CocoaPods, you can integrate the SDK framework directly or use Swift Package Manager instead.

CocoaPods

For integration via Cocoapods, please follow Cocoapods Integration Guide.

Swift Package Manager

For integration via Swift Package Manager, please follow SPM Integration Guide.

Manual installation

For manual integration, please follow Manual Integration Guide.

Step 2: Configure biometric authentication

The SDK supports biometric authentication (Touch ID / Face ID) in Admin mode

Note:

  • To use Face ID authentication, you need to add:
<key>NSFaceIDUsageDescription</key>
<string>Why is my app authenticating using face id?</string>

to your Info.plist file. Failure to do so results in a dialog that tells the user your app has not provided the Face ID usage description.

Step 3: Configure the codeless Thunderhead SDK for iOS

Enable your app to automatically recognize Interactions in your app, by executing the following steps:

Initialize the SDK

Complete the following steps to initialize the SDK.

Import the SDK’s module

  1. Open your App Delegate file.
  2. Add the following line at the top of the file below your own import statements:
Swift:
```swift
import Thunderhead
```

Objective-C:
```objective-c
@import Thunderhead;
```

Set up the SDK in User mode for App Store builds

To start tracking, capturing, and receiving Optimizations with the Thunderhead SDK in User mode, you must first initialize it with your Thunderhead API parameters. You can find your Thunderhead API parameters on the Thunderhead ONE website or in Salesforce Interaction Studio.

With your parameters ready at hand, add the following lines to the top of the didFinishLaunchingWithOptions:

Swift:

One.startSessionWithSK("ONE-XXXXXXXXXX-1022",
                    uri:"myAppsNameURI",
                 apiKey:"f713d44a-8af0-4e79-ba7e-xxxxxxxxxxxxxxxx",
           sharedSecret:"bb8bacb2-ffc2-4c52-aaf4-xxxxxxxxxxxxxxxx",
                 userId:"api@yourCompanyName",
              adminMode:false,
               hostName:"eu2.thunderhead.com")

Objective-C:

[One startSessionWithSK:@"ONE-XXXXXXXXXX-1022"
                    uri:@"myAppsNameURI"
                 apiKey:@"f713d44a-8af0-4e79-ba7e-xxxxxxxxxxxxxxxx"
           sharedSecret:@"bb8bacb2-ffc2-4c52-aaf4-xxxxxxxxxxxxxxxx"
                 userId:@"api@yourCompanyName"
              adminMode:NO
               hostName:@"eu2.thunderhead.com"];

Set up the SDK in Admin mode for internal distribution

We recommend adding the Admin mode function on your internal builds, behind a debug settings function or on a dedicated build pipeline, as described here.

To use the framework in Admin mode, simply change the adminMode boolean to true, as follows:

Swift:

One.startSessionWithSK("ONE-XXXXXXXXXX-1022",
                    uri:"myAppsNameURI",
                 apiKey:"f713d44a-8af0-4e79-ba7e-xxxxxxxxxxxxxxxx",
           sharedSecret:"bb8bacb2-ffc2-4c52-aaf4-xxxxxxxxxxxxxxxx",
                 userId:"api@yourCompanyName",
              adminMode:true,
               hostName:"eu2.thunderhead.com")

Objective-C:

[One startSessionWithSK:@"ONE-XXXXXXXXXX-1022"
                    uri:@"myAppsNameURI"
                 apiKey:@"f713d44a-8af0-4e79-ba7e-xxxxxxxxxxxxxxxx"
           sharedSecret:@"bb8bacb2-ffc2-4c52-aaf4-xxxxxxxxxxxxxxxx"
                 userId:@"api@yourCompanyName"
              adminMode:YES
               hostName:@"eu2.thunderhead.com"];

Note:

  • Dynamic configuration of both Admin and User mode is supported.

You have now successfully integrated the codeless Thunderhead SDK for iOS.

Additional codeless integration considerations

For Salesforce Interaction Studio integrations

When integrating with Salesforce Interaction Studio you can set the Admin mode theme to match the Interaction Studio look and feel, as follows:

Swift:

One.setTheme(OneTheme.InteractionStudio)

Objective-C:

 [One setTheme:OneThemeInteractionStudio];

Note:

  • By default the SDK will be launched using the Thunderhead ONE theme. You should only use the Interaction Studio theme if you are a Salesforce customer.

ViewController/View lifecycle overriding rules

The framework listens to a number of UIViewController and UIView methods to provide the desired functionality. Those methods are:

  • viewWillAppear
  • viewDidAppear
  • viewWillDisappear
  • didMoveToWindow

If you use these methods in your code, please ensure to call super when implementing them.

Sending codeless Interactions based on the list of Interactions created under a Touchpoint

In order to reduce the number of unnecessary Interaction requests sent automatically by the SDK, only codeless Interactions with explicit Interaction paths created under a Touchpoint and configured with at least one point are sent to Thunderhead ONE or Salesforce Interaction Studio. This configuration change has been introduced in version 5.3.0 of the iOS SDK.

Note:

  • The SDK will only send codeless Interactions if they have been created under a Touchpoint and/or if they match wildcard rules defined under a Touchpoint.
  • For a codeless Interaction to be sent by the SDK this Interaction needs to contain at least one Activity Capture Point, Attribute Capture Point, and/or Optimization Point.
  • If you are running the SDK in User mode, you need to ensure that all Interactions and related points have been fully published, before the SDK will trigger a request.

Additional features of Thunderhead SDK

For additional features of Thunderhead SDK, please follow Additional Features Guide.

Troubleshooting guide

Having trouble with Thunderhead and your iOS project? Visit the Troubleshooting Guide

Questions or need help

Salesforce Interaction Studio support

For Salesforce Marketing Cloud Interaction Studio questions, please submit a support ticket via https://help.salesforce.com/home

Thunderhead ONE support

The Thunderhead team is available 24/7 to answer any questions you have. Just email [email protected] or visit our docs page for more detailed installation and usage information.

GitHub

link
Stars: 0
Last commit: 52 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

ONE SDK for iOS v6.0.0
3 years ago
  • [BREAKING] The Thunderhead SDK is now distributed as an XCFramework bundle. The binary contains architecture slices for arm64, armv7 for iOS and arm64, i386, x86_64 for the simulator. For further details on this see our migration guide.
  • [BREAKING] Updated minimum deployment target to iOS 9.0.
  • [BREAKING] Added support for using the Thunderhead SDK with Xcode 12.3. The Thunderhead SDK now requires Xcode 12+ (iOS 14). For further details on this see our readme.
  • [BREAKING] Removed the push notification functionality from the Thunderhead SDK. For further details on this see our migration guide.
  • [NEW] Added support for integrating the Thunderhead SDK via Swift Package Manager. For further details on this see our readme.
  • [NEW] Added support for Interaction tracking for iOS 13+ Modals.
  • [UPDATE] Added more granular debug logging to facilitate better customer support when SDKs are migrated from an older to a newer version.
  • [BUGFIX] Fixed an issue where the app name was not pulled correctly from the bundle identifier.
  • [BUGFIX] Fixed an issue where mini notifications were not always displayed on iOS 13+ Modals.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics