Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

No description, website, or topics provided.

Resources

License

Packages

No packages published