Please follow the steps below to integrate Quixxi Analytics SDK to iOS applications:
- Create a new app in Quixxi Portal using
Add New button
. - In
"Create your app"
dialog give a name of your application and click Continue - Click the newly created app and choose
"Control"
in header tab and choose Package in left side menu. - Click
"Add Platform"
and choose iOS and check Analytics in Select module option. - Give proper package name for your application and hit
"Start Packaging"
.
Let’s see how to setup Quixxi Analytics with your application in following steps. - In your Xcode project drag and drop the QuixxiAnalytics.framework and QuixxiActivation.framework into your project.
- After adding the QuixxiActivation.framework, select Your Project target > Build phases-> Copy Bundle Resources-> add Quixxikeys.txt file from inside the activation framework.
- Under the general tab look for the embedded binaries, click the (+) plus button and choose the QuixxiAnalytics.framework and QuixxiActivation.framework.
- In your Xcode project drag and drop the(QuixxiAnalyticsLibraryiOS) folder into your project.
- In your Xcode project drag and drop the QuixxiActivation.framework you received to the library.
- To add the framework to the project, click on the Project and choose targets of your project and choose the general tab.
- Under the general tab look for the embedded binaries, click the (+) plus button and choose the QuixxiActivation.framework.
- After adding the QuixxiActivation.framework ,select build phase->copy bundle resource->add Quixxikeys.txt file from inside the activation framework.
- Select project and choose->build phase->link library and add “libsqlite3.0.tbd”.
Initialising the Quixxi Analytics SDK
Initialise the Quixxi Analytics SDK, first import QuixxiAnalytics.h
file in the Appdelegate.h.
<span style="font-size: 16px;"><span style="font-family: 'Times New Roman',Times,serif;">-#import <QuixxiAnalytics/QuixxiAnalytics.h></span></span>
Now add the following code to application:didFinishLaunchingWithOptions in AppDelegate.m file.
<span style="font-size: 16px;"><span style="font-family: 'Times New Roman',Times,serif;">[[QuixxiAnalytics sharedAnalytics] startAnalytics];</span></span>
Sending events
Include header file QuixxiAnalytics.h in the class ,where you are sending the event.
<span style="font-size: 16px;"><span style="font-family: 'Times New Roman',Times,serif;">[[QuixxiAnalytics sharedAnalytics] addEventTitle:<Title> Description:<Description> withCompletion:^(NSString *resultString, NSError *error) { //Do something }];</span></span>
title - a string unique identifier of your event
description - a string describes your event value
<span style="font-size: 16px;"><span style="font-family: 'Times New Roman',Times,serif;">[[QuixxiAnalytics sharedAnalytics] addEventTitle:<Title> Description:<Description> EventDetail:<Event details> EventInfo:<Event dictionary> completion:^(NSString *resultString, NSError *error) { //Do something }];</span></span>
title - a string unique identifier of your event
description - a string describes your event value
eventdetail- a string additional value of event
eventinfo-an object value, NSDictionary value
Example
<span style="font-size: 16px;"><span style="font-family: 'Times New Roman',Times,serif;">NSDictionary *eventDictionary = [NSDictionary dictionaryWithObjectsAndKeys:@"user@email.com",@"email",@"testuser",@"username", nil]; [[QuixxiAnalytics sharedAnalytics] addEventTitle:<Title> Description:<Description> EventDetail:<Event> EventInfo:<eventDictionary> withCompletion:^(NSString *resultString, NSError *error) { if(error==nil){ NSLog(@"event sent"); }else{ NSLog(@"Error: %@",[error localizedDescription]); } }];</span></span>
Update User Email
<span style="font-size: 16px;"><span style="font-family: 'Times New Roman',Times,serif;">[[QuixxiAnalytics sharedAnalytics] setEmail:<EmailId>];</span></span>
EmailId - Update user mail id
<span style="font-size: 16px;"><span style="font-family: 'Times New Roman',Times,serif;">[[QuixxiAnalytics sharedAnalytics] setEmail:@“test@gmail.com”];</span></span>