Skip to content

Installation

Kalle Chen edited this page Jun 9, 2025 · 13 revisions

Step 1 - Install OmniSegment

Swift Installation

Swift Package Manager

Add the following dependency to your Package.swift file:

swift
.package(url: "https://github.com/beBit-tech/bebit-tech-ios-app-sdk", from: "0.0.1")

CocoaPods

Add the following to you Podfile:

target 'YourAppTargetName' do
  pod 'OmniSegmentKit', '0.0.1'
end

Objective-C Installation

Add the following to your Podfile:

Objective-C
target 'ObjcApp' do
  use_frameworks!
  
  # Specify version 1.0.2-beta.0
  pod 'OmniSegmentKit', '1.0.2-beta.0'
  
  target 'ObjcAppTests' do
    inherit! :search_paths
    # Pods for testing
  end

Create a bridging header file :

#ifndef ObjcApp_Bridging_Header_h
#define ObjcApp_Bridging_Header_h

// Add the SDK import
#import <OmniSegmentKit/OmniSegmentKit-Swift.h>

#endif /* ObjcApp_Bridging_Header_h */

Troubleshooting

Important

If you encounter the error: 'OmniSegmentKit/OmniSegmentKit-Swift.h' file not found, ensure the following build settings are configured correctly:

  • Set Always Embed Swift Standard Libraries = Yes
  • Set Enable Modules (C and Objective-C) = Yes

Step 2 - Initialize OmniSegment

To import the OmniSegment library and initialize it, add the following code to your application delegate:

Swift
import OmniSegmentKit

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
    OmniSegment.initialize("YOUR_API_KEY", tid: "YOUR_iOS_TID")
}
Objective-C
#import <OmniSegmentKit/OmniSegmentKit-Swift.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [OmniSegment initialize:@"YOUR_API_KEY" withTid:@"YOUR_iOS_TID"];
}

If your app is using a UISceneDelegate, ensure that you include your OmniSegment initialization code in the SceneDelegate.

Swift
import OmniSegmentKit

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
    OmniSegment.initialize("YOUR_API_KEY", tid: "YOUR_iOS_TID")
}
Objective-C
#import <OmniSegmentKit/OmniSegmentKit-Swift.h>

- (void)scene:(UIScene )scene willConnectToSession:(UISceneSession )session options:(UISceneConnectionOptions )connectionOptions {
  [OmniSegment initialize:@"YOUR_API_KEY" withTid:@"YOUR_iOS_TID"];
}

Clone this wiki locally