spresso-ios-sdk is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'spresso-ios-sdk'
Initialize the library with your current environment and Org ID.
Spresso.sharedInstance(for: .prod)
Spresso.sharedInstance().orgId = <org_id>
[Spresso sharedInstanceForEnvironment:SpressoEnvironmentProd];
[Spresso sharedInstance].orgId = @"<org_id>";
Spresso.sharedInstance().identify("<user_id>")
[[Spresso sharedInstance] identify:@"<user_id"];
Example of sending data when a user views a product
Spresso.sharedInstance().track(SpressoEventTypeViewPage, properties: ["variantSku": "<variant_sku>",
"variantName": "<variant_name>",
"variantPrice": "<variant_price>"])
[[Spresso sharedInstance] track:SpressoEventTypeViewProduct properties:@{ @"variantSku": @"<variant_sku>",
@"variantName": @"<variant_name>",
@"variantPrice": @"<variant_price>"
}];
Spresso, developer@spresso.com
spresso-ios-sdk is available under the MIT license. See the LICENSE file for more info.