Commit 9ab20935 authored by Bosko Petreski's avatar Bosko Petreski Committed by Bosko Petreski

init function for Tracking

parent 683e6967
This diff is collapsed.
......@@ -11,6 +11,7 @@
#endif
#import "PrimedIO.h"
#import "PrimedTracker.h"
FOUNDATION_EXPORT double PrimedIOVersionNumber;
FOUNDATION_EXPORT const unsigned char PrimedIOVersionString[];
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
......@@ -20,12 +20,38 @@
<view key="view" contentMode="scaleToFill" id="TpU-gO-2f1">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="6zf-q2-fpp">
<rect key="frame" x="123" y="66" width="128" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Convert"/>
<connections>
<action selector="onBtnMakeConvert:" destination="whP-gf-Uak" eventType="touchUpInside" id="qeG-7r-m2K"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oJz-KF-Pg5">
<rect key="frame" x="123" y="142" width="128" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Personalise"/>
<connections>
<action selector="onBtnPersonalise:" destination="whP-gf-Uak" eventType="touchUpInside" id="4F4-UL-jvg"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YBN-oZ-fUW">
<rect key="frame" x="123" y="210" width="128" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="TrackView"/>
<connections>
<action selector="onBtnTrackView:" destination="whP-gf-Uak" eventType="touchUpInside" id="mtO-m8-INm"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="305" y="433"/>
<point key="canvasLocation" x="304.80000000000001" y="432.23388305847078"/>
</scene>
</scenes>
</document>
......@@ -8,6 +8,7 @@
#import "PIOViewController.h"
#import <PrimedIO/PrimedIO.h>
#import <PrimedIO/PrimedTracker.h>
@interface PIOViewController ()
......@@ -51,6 +52,8 @@
[PrimedIO.sharedInstance initWithPublicKey:@"mypubkey" secretKey:@"mysecretkey" connectionString:@"https://gw.staging.primed.io:443"];
PrimedIO.sharedInstance.debug = YES;
// Create PrimedTracker instance
[PrimedTracker.sharedInstance initWithPublicKey:@"mypubkey" secretKey:@"mysecretkey" connectionString:@"https://gw.staging.primed.io:443" trackingConnectionString:@"https://gw.staging.primed.io:553" heartbeatInterval:10 eventQueueRetryInterval:10];
}
-(void)didReceiveMemoryWarning{
[super didReceiveMemoryWarning];
......
......@@ -10,6 +10,10 @@
@interface PrimedTracker : PrimedIO
@property (nonatomic,strong) NSString *trackingConnectionString;
@property (nonatomic,assign) NSInteger heartbeatInterval;
@property (nonatomic,assign) NSInteger eventQueueRetryInterval;
/**
* Create instance of PrimedTracker class
* @return PrimedTracker shared instance
......
......@@ -31,12 +31,22 @@
if(self.debug){
PrimedIOLog(@"Primed Tracker Debug Activated");
}
if(!self.public_key){
self.public_key = publicKey;
}
if(!self.nonce){
self.nonce = [NSString stringWithFormat:@"%.f",NSDate.date.timeIntervalSince1970];
}
if(!self.sha512Signature){
NSString *prepSignature = [NSString stringWithFormat:@"%@%@%@",publicKey,secretKey,self.nonce];
self.sha512Signature = [PrimedIO hmac:prepSignature];
}
if(!self.connectionStringPrimedIO){
self.connectionStringPrimedIO = connectionString;
}
self.public_key = publicKey;
self.nonce = [NSString stringWithFormat:@"%.f",NSDate.date.timeIntervalSince1970];
NSString *prepSignature = [NSString stringWithFormat:@"%@%@%@",publicKey,secretKey,self.nonce];
self.sha512Signature = [PrimedIO hmac:prepSignature];
self.connectionStringPrimedIO = connectionString;
self.heartbeatInterval = heartbeatInterval;
self.eventQueueRetryInterval = eventQueueRetryInterval;
}
#pragma mark - API Main Functions
......
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