Latest 0.1.0
Homepage https://github.com/callstats-io/callstats-ios
License Apache License, Version 2.0
Platforms ios 9.0
Dependencies GoogleWebRTC
Authors

CallStats for iOS

Callstats WebRTC analytic library for iOS.

Getting started

Cocoapods

pod 'Callstats'

Create Callstats object

callstats = Callstats(
    appID: appID, // Application ID from Callstats
    localID: localID, // current user ID
    deviceID: deviceID, // unique device ID
    jwt: jwt, // jwt from server for authentication
    username: username) // (Optional) user alias

Send events

When starting the call, call startSession with room identifier

callstats.startSession(confID: room)

These events need to be forwarded to the library in order to start tracking the call. Add followings into your WebRTC RTCPeerConnectionDelegate For example:

func peerConnection(_ peerConnection: RTCPeerConnection, didChange newState: RTCIceConnectionState) {
    callstats.reportEvent(remoteUserID: peerId, event: CSIceConnectionChangeEvent(state: newState))
}

func peerConnection(_ peerConnection: RTCPeerConnection, didChange newState: RTCIceGatheringState) {
    callstats.reportEvent(remoteUserID: peerId, event: CSIceGatheringChangeEvent(state: newState))
}

func peerConnection(_ peerConnection: RTCPeerConnection, didChange stateChanged: RTCSignalingState) {
    callstats.reportEvent(remoteUserID: peerId, event: CSSignalingChangeEvent(state: stateChanged))
}

And when call finished

callstats.stopSession()

You can take a look at how to send more events in demo application.

Latest podspec

{
    "name": "Callstats",
    "version": "0.1.0",
    "summary": "WebRTC Analytics library for iOS",
    "homepage": "https://github.com/callstats-io/callstats-ios",
    "license": "Apache License, Version 2.0",
    "authors": {
        "Amornchai Kanokpullwad": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/callstats-io/callstats-ios.git",
        "tag": "0.1.0"
    },
    "source_files": "Callstats/**/*.swift",
    "dependencies": {
        "GoogleWebRTC": [
            "~> 1.0"
        ]
    }
}

Pin It on Pinterest

Share This