Skip to content

Configuration, initialization and use of the IOMb Library iOS

To use the IOMb Library iOS for IOMb measurement, the measurement system IOMb (BASE) must be used. The following describes how to configure, initialize and use an IOMb session for measurement.

note

The parameters required for this, such as site ID and base URL, are assigned individually by INFOnline for each site or explained in the following and are only exemplary in the following illustration.


Initialization of an IOMb Session:

Creation of an IOMBSessionConfiguration object and initialization of the IOMb Session

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
import IOMbLibrary

...

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: 
    [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        startIOMbSession()
        return true
    }

private func startIOMbSession() {
    guard let url = URL(string: "https://data-ef4e2c0163.example.com") else { return }
    let configuration = IOMBSessionConfiguration(offerIdentifier: "site ID", baseURL: url)
v1.1.+:  IOMBSession.defaultSession(for: .iomb).start(with: configuration)
v1.0.x:  IOMBSession.defaultSession.start(with: configuration)
    }
site ID and https://data-ef4e2c0163.example.com are examples, you get your offer-specific values from INFOnline. If you are running the service platform as self-hosting, the following chapter describes how the baseUrl is structured.


Event Logging:

Events can be logged in the view controllers of the app, e.g. the call of a view:

1
2
3
 let event = IOMBViewEvent(type: .appeared, category: "Home", comment: nil)
v1.1.+: IOMBSession.defaultSession(for: .iomb).logEvent(event)
v1.0.x: IOMBSession.defaultSession.logEvent(event)

Last update: July 14, 2023