Commit 11b91d49 authored by Bosko Petreski's avatar Bosko Petreski Committed by Bosko Petreski

improvements

parent 2dc5d60e
......@@ -60,8 +60,8 @@
// Primed.sharedInstance.debug = YES;
// Create PrimedTracker instance
[PrimedTracker.sharedInstance initWithPublicKey:@"mypubkey" secretKey:@"mysecretkey" connectionString:@"https://gw.staging.primed.io:443" trackingConnectionString:@"http://18.191.69.104:5001/v1" heartbeatInterval:10 eventQueueRetryInterval:10];
PrimedTracker.sharedInstance.debug = YES;
[PrimedTracker.sharedInstance initWithPublicKey:@"mypubkey" secretKey:@"mysecretkey" connectionString:@"https://gw.staging.primed.io:443" trackingConnectionString:@"http://18.191.69.104:5001/v1" heartbeatInterval:10 eventQueueRetryInterval:10];
}
-(void)didReceiveMemoryWarning{
[super didReceiveMemoryWarning];
......
......@@ -9,6 +9,7 @@
#import <Foundation/Foundation.h>
#import "Primed.h"
@import CoreLocation;
@import SocketIO;
typedef NS_ENUM(NSUInteger, InteractionType) {
......@@ -55,11 +56,26 @@ typedef NS_ENUM(NSUInteger, ScrollDirection) {
-(void)initWithPublicKey:(NSString *)publicKey secretKey:(NSString *)secretKey connectionString:(NSString *)connectionString trackingConnectionString:(NSString *)trackingConnectionString heartbeatInterval:(NSInteger)heartbeatInterval eventQueueRetryInterval:(NSInteger)eventQueueRetryInterval;
/**
* Create instance of PrimedTracker class
* @param uri URL Tracking
* Track Clicks
* @param x X Coordinate
* @param y Y Coordinate
* @param interactionType Enumeration click type
*/
-(void)trackClickX:(NSInteger)x y:(NSInteger)y interactionType:(InteractionType)interactionType;
/**
* Track URI
* @param uri URI Tracking
*/
-(void)trackView:(NSString *)uri;
/**
* Track Scrolling
* @param scrollDirection Enumeration scroll type
* @param distance Distance scrolling
*/
-(void)trackScroll:(ScrollDirection)scrollDirection distance:(NSInteger)distance;
/**
* Track when enter to screen
* @param campaign Campaign
......@@ -74,6 +90,23 @@ typedef NS_ENUM(NSUInteger, ScrollDirection) {
*/
-(void)trackExitViewPort:(NSString *)campaign elements:(NSArray *)elements;
/**
* Track position change
* @param location CLLocation object from GPS
*/
-(void)trackPositionChange:(CLLocation *)location;
/**
* Track when opening application
* @param uri URI Tracking
*/
-(void)trackStart:(NSString *)uri;
/**
* Track when exit from application
*/
-(void)trackEnd;
/**
* Track custom event
* @param data Custom JSON Data for event
......
......@@ -9,8 +9,6 @@
#import "PrimedTracker.h"
#import "Primed.h"
@import CoreLocation;
@implementation PrimedTracker
#pragma mark - SimpleDatabase
......@@ -169,7 +167,7 @@
}];
[self emitPayload:payload];
}
-(void)trackLocationChange:(CLLocation *)location{
-(void)trackPositionChange:(CLLocation *)location{
NSDictionary *payload = [self basicEventProperties:@"positionchange" eventObject:@{@"latitude":@(location.coordinate.latitude),
@"longitude":@(location.coordinate.longitude),
@"accuracy":@(location.horizontalAccuracy)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment