iOS
Last updated
Last updated
Add the KISSmetricsSDK.framework
to your project.
Within AppDelegate.m, import the framework like so:
Still in the AppDelegate.m
file, find the didFinishLaunching
or didFinishLaunchingWithOptions
method and add the following code as the first line in that method. Be sure to apply your API key.
autoRecordInstalls()
Calling this records two events:
Installed App
Updated App
autoSetAppProperties() Calling this sets the following properties:
App Version : 1.0.0
App Build : 101
autoSetHardwareProperties() Calling this sets the following properties:
Device Manufacturer: Apple
Device Platform: iPhone
Device Model: iPhone 5s
System Name: iOS
System Version: 7.0.4
In the new SDK, all calls to record events, properties, identities and aliases are immediately passed onto a background thread for processing and delivery.
In our version 1, the processing of these calls was handled by the same thread that made the call to record before being delivered asynchronously. This wasn’t optimal as an application’s main thread is responsible for view updates and user interactions.
As a third party addition to our customers’ apps, we should use as little of the main thread as possible to ensure that our SDK doesn’t contribute to any lag in the users’ experience of their apps.
The SDK will archive all activity in a send queue and attempt to deliver from that queue as connectivity permits.
Size (compiled): 942kb
Memory Overhead
idle: 330.32kb (under iOS 7)
per avg. event with properties: estimated at < 500 bytes (< 200 for required params plus assumed < 300 bytes for average event with properties). During archiving of each event with properties, approximately 3kb of memory is allocated and quickly released.
iOS version support: iOS 5.1 (>99% of iOS devices)