forked from orta/ARAnalytics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ARDSL.h
84 lines (71 loc) · 3.07 KB
/
ARDSL.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//
// ARDSL.h
// Artsy
//
// Created by Ash Furrow on 04/29/14.
// Copyright (c) 2014 Artsy. All rights reserved.
//
#import "ARAnalytics.h"
extern NSString * const ARAnalyticsTrackedEvents;
extern NSString * const ARAnalyticsTrackedScreens;
extern NSString * const ARAnalyticsClass;
extern NSString * const ARAnalyticsDetails;
extern NSString * const ARAnalyticsPageName;
extern NSString * const ARAnalyticsPageNameKeyPath;
extern NSString * const ARAnalyticsEventName;
extern NSString * const ARAnalyticsSelectorName;
extern NSString * const ARAnalyticsEventProperties;
extern NSString * const ARAnalyticsShouldFire;
typedef NSDictionary*(^ARAnalyticsEventPropertiesBlock)(id instance, NSArray *arguments);
typedef BOOL(^ARAnalyticsEventShouldFireBlock)(id instance, NSArray *arguments);
@interface ARAnalytics (DSL)
/**
* Startup your ARAnalytics instance with an additional DSL for triggering calls after methods are done
*
* @param analyticsDictionary The normal ARAnalytics dictionary with provider keys & secrets
* @param configurationDictionary A dictionary consisting of ARAnalyticsTrackedEvents & ARAnalyticsTrackedScreens
* @see addEventAnalyticsHooks, addScreenMonitoringAnalyticsHook
*/
+ (void)setupWithAnalytics:(NSDictionary *)analyticsDictionary configuration:(NSDictionary *)configurationDictionary;
/**
* Register a new hook in ARAnalytics
*
* @param analyticsDictionary A dictionary with two keys, ARAnalyticsClass which takes a class
* saying what to to hook into and ARAnalyticsDetails holding details
* like ARAnalyticsSelectorName / ARAnalyticsEventName /
* ARAnalyticsEventProperties / ARAnalyticsShouldFire
*/
+ (void)addEventAnalyticsHooks:(NSDictionary *)analyticsDictionary;
/**
* Remove a hook in from ARAnalytics, user-code will nit be touched
*
* @param analyticsDictionary Same formatted dictionary as addEventAnalyticsHooks
*
* @return Whether removal was successful
*/
+ (BOOL)removeEventsAnalyticsHooks:(NSDictionary *)analyticsDictionary;
/**
* Add a screen monitoring Analytics hook at runtime
*
* @param screenDictionary A dictionary with two keys, ARAnalyticsClass which takes a class
* for the class to hook into and ARAnalyticsDetails holding details
* like ARAnalyticsSelectorName / ARAnalyticsEventName / ARAnalyticsEventProperties.
*/
+ (void)addScreenMonitoringAnalyticsHook:(NSDictionary *)screenDictionary;
/**
* Remove a screen monitoring analytics hook at runtime
*
* @param screenDictionary A dictionary with two keys, ARAnalyticsClass which takes a class
* for the class to hook into and ARAnalyticsSelectorName passing the
* selector as a string.
*
* @return Whether the removal was a success
*/
+ (BOOL)removeScreenMonitoringAnalyticsHooks:(NSDictionary *)screenDictionary;
/**
* Remove all DSL based analytics calls
*
* @return Whether all of removals were successful
*/
+ (BOOL)removeAllAnalyticsHooks;
@end