forked from airbrake/airbrake-ios
/
HTNotifier.h
129 lines (93 loc) · 2.94 KB
/
HTNotifier.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
//
// HTNotifier.h
// HoptoadNotifier
//
// Created by Caleb Davenport on 10/2/10.
// Copyright 2010 GUI Cocoa, LLC. All rights reserved.
//
#if TARGET_OS_IPHONE
#elif TARGET_OS_MAC
#else
#error [Hoptoad] Unsupported platform
#endif
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import "HTNotifierDelegate.h"
#import "HTFunctions.h"
#import "HTNotice.h"
// notifier version
extern NSString * const HTNotifierVersion;
/*
use these variables in your alert title, alert body, and
environment name to have their values replaced at runtime
*/
// bundle name of the app
extern NSString * const HTNotifierBundleName;
// bundle version of the app
extern NSString * const HTNotifierBundleVersion;
/*
use these standard environment names to have default
values provided to hoptoad
*/
extern NSString * const HTNotifierDevelopmentEnvironment;
extern NSString * const HTNotifierAdHocEnvironment;
extern NSString * const HTNotifierAppStoreEnvironment;
extern NSString * const HTNotifierReleaseEnvironment;
/*
HTNotifier is the primary class of the notifer library
start the notifier by calling
startNotifierWithAPIKey:environmentName:
access the shared instance by calling sharedNotifier
*/
@interface HTNotifier : NSObject {
@private
NSString *apiKey;
NSString *environmentName;
NSMutableDictionary *environmentInfo;
SCNetworkReachabilityRef reachability;
id<HTNotifierDelegate> delegate;
BOOL useSSL;
}
@property (nonatomic, readonly) NSString *apiKey;
@property (nonatomic, readonly) NSString *environmentName;
@property (nonatomic, assign) id<HTNotifierDelegate> delegate;
/*
set string key-value pairs on this item to have additional
context for your crash notices. by default this is a blank
mutable dictionary
NOTE: do not use this to transmit UDID's, location, or any
other private user information without permission
*/
@property (nonatomic, readonly) NSMutableDictionary *environmentInfo;
/*
control whether notices are posted using SSL. your account
must support this feature
default:NO
*/
@property (nonatomic, assign) BOOL useSSL;
/*
this method is the entry point for the library. any code
executed after this method call is monitored for crashes
and signals
the values for key and environment name must not be nil
and must have a length greater than 0
include any of the above constant strings in the
enviromnent name to have the value replaced by the library
*/
+ (void)startNotifierWithAPIKey:(NSString *)key environmentName:(NSString *)name;
/*
access the shared notifier object.
if this is called before
startNotifierWithAPIKey:environmentName:
nil will be returned.
*/
+ (HTNotifier *)sharedNotifier;
/*
writes a test notice to disk if one does not exist already
*/
- (void)writeTestNotice;
@end
// internal
extern NSString * const HTNotifierDirectoryName;
extern NSString * const HTNotifierPathExtension;
extern NSString * const HTNotifierAlwaysSendKey;