Logo
iOS Behaviour SDK
To get Behaviour Data for Keystrokes, Mouse Movements, Scroll Metrics, Touch Metrics, you can add the below methods to initialize it.
How to Install
toast-icon
Requirements
  1. iOS 13.0 or above
  2. Swift version 5.0 and above
  1. Pod Installation
    copy-icon
    copy-icon
    pod 'SenseBehaviourSDK', '~> 0.0.2'
    pod update
  2. Import SDK
    copy-icon
    copy-icon
    import SenseBehaviourSDK
    To initialize the SDK add the below line of code with the public key you retrieved from Sense client panel. If you don't have a public key create new one and call that below function.
    copy-icon
    copy-icon
    func initSenseBehaviour(){
            let senseBehaviourConfig = SenseBehaviourConfig()
            senseBehaviourConfig.apiKey = "Your Unique Public API Key"
            senseBehaviourConfig.reference_id = "Your Reference ID"
            senseBehaviourConfig.sense_id = "Your Sense ID"
            SenseBehaviour.initSDK(senseBehaviourConfig: senseBehaviourConfig, withDelegate: self)
        }
  3. Add to start tracking into viewWillAppear
    copy-icon
    copy-icon
    SenseBehaviour.startTracking(in: self.view)
  4. Add to get Behaviour data
    Use the below code to obtain the Device behaviour data.
    copy-icon
    copy-icon
    SenseBehaviour.getBehaviourData(withDelegate: self)
  5. Implement Delegate Method
    Use the below code to obtain the Device result.
    copy-icon
    copy-icon
    extension ViewController: SenseBehaviourSDKDelegate{
         func onFailureBehaviour(message: String) {
            // Failure Callback.
        }
         func onSuccessBehaviour(data: String) {
            // Success Callback
        }
    }