ParselyiOS  2.2
The Parsely iOS Toolkit
 All Classes Functions Variables Typedefs Enumerations Properties Pages
ParselyTracker.h
1 /*
2  ParselyTracker.h
3  ParselyiOS
4 
5  Copyright 2016 Parse.ly
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 */
19 
20 #import <Foundation/Foundation.h>
21 
22 #define PLog(s, ...)
23 
29 @interface ParselyTracker : NSObject <NSURLConnectionDelegate>
30 {
31  @private
32  NSTimer *_timer;
33  NSMutableArray *eventQueue;
34  NSString *uuidKey;
35  NSString *storageKey;
36  NSString *rootUrl;
37  NSMutableDictionary *deviceInfo;
38  NSDictionary *idNameMap;
39  @public
40  NSInteger storageSizeLimit;
41  NSInteger queueSizeLimit;
42 }
43 
48 typedef enum _kIdType {
49  kUrl, kPostId
50 } kIdType;
51 
52 @property (nonatomic) NSString *apiKey;
53 @property (nonatomic) NSString *urlref;
54 @property (nonatomic) NSInteger flushInterval;
55 @property (nonatomic) BOOL shouldFlushOnBackground;
63 +(ParselyTracker *)sharedInstance;
64 
73 +(ParselyTracker *)sharedInstanceWithApiKey:(NSString *)apikey andFlushInterval:(NSInteger)flushint;
74 
84 +(ParselyTracker *)sharedInstanceWithApiKey:(NSString *)apikey andFlushInterval:(NSInteger)flushint andUrlref:(NSString *)urlref_;
85 
93 +(ParselyTracker *)sharedInstanceWithApiKey:(NSString *)apikey;
94 
99 -(void)trackURL:(NSString *)url;
100 
105 -(void)trackPostID:(NSString *)postid;
106 
113 -(void)track:(NSString *)identifier withIDType:(kIdType)idtype;
114 
121 -(void)flush;
122 
128 -(void)stopFlushTimer;
129 
135 -(void)setFlushTimer;
136 
147 -(id)initWithApiKey:(NSString *)apikey andFlushInterval:(NSInteger)flushint andUrlref:(NSString *)urlref_;
148 
157 -(void)sendBatchRequest:(NSSet *)queue;
158 
164 -(NSInteger)queueSize;
165 
170 -(NSInteger)storedEventsCount;
171 
176 -(BOOL)flushTimerIsActive;
177 
178 @end
Manages pageview events and analytics data for Parsely on iOS.
Definition: ParselyTracker.h:29
NSInteger queueSizeLimit
Definition: ParselyTracker.h:42
enum ParselyTracker::_kIdType kIdType
types of post identifiers
NSInteger storageSizeLimit
Definition: ParselyTracker.h:41