@@ -15,15 +15,48 @@ - (id) initWithDictionary:(NSDictionary*)dict
15
15
self = [super init ];
16
16
if (self) {
17
17
self.application_token = [dict valueForKey: kNRMA_LICENSE_KEY ];
18
- self.collect_network_errors = [[dict valueForKey: kNRMA_COLLECT_NETWORK_ERRORS ] boolValue ];
18
+
19
+ if ([dict objectForKey: kNRMA_COLLECT_NETWORK_ERRORS ]) {
20
+ self.collect_network_errors = [[dict valueForKey: kNRMA_COLLECT_NETWORK_ERRORS ] boolValue ];
21
+ }
22
+ else {
23
+ self.collect_network_errors = true ;
24
+ }
25
+
19
26
self.cross_process_id = [dict valueForKey: kNRMA_CROSS_PROCESS_ID ];
20
- self.data_report_period = [[dict valueForKey: kNRMA_DATA_REPORT_PERIOD ] intValue ];
27
+
28
+ if ([dict objectForKey: kNRMA_DATA_REPORT_PERIOD ]) {
29
+ self.data_report_period = [[dict valueForKey: kNRMA_DATA_REPORT_PERIOD ] intValue ];
30
+ }
31
+ else {
32
+ self.data_report_period = NRMA_DEFAULT_REPORT_PERIOD;
33
+ }
34
+
21
35
self.data_token = [[NRMADataToken alloc ] init ];
22
36
self.data_token .clusterAgentId = [[[dict valueForKey: kNRMA_DATA_TOKEN ] objectAtIndex: 0 ] longLongValue ];
23
37
self.data_token .realAgentId = [[[dict valueForKey: kNRMA_DATA_TOKEN ] objectAtIndex: 1 ] longLongValue ];
24
- self.error_limit = [[dict valueForKey: kNRMA_ERROR_LIMIT ] intValue ];
25
- self.report_max_transaction_age = [[dict valueForKey: kNRMA_REPORT_MAX_TRANSACTION_AGE ] intValue ];
26
- self.report_max_transaction_count = [[dict valueForKey: kNRMA_REPORT_MAX_TRANSACTION_COUNT ]intValue];
38
+ if ([dict objectForKey: kNRMA_ERROR_LIMIT ]) {
39
+
40
+ self.error_limit = [[dict valueForKey: kNRMA_ERROR_LIMIT ] intValue ];
41
+ }
42
+ else {
43
+ self.error_limit = NRMA_DEFAULT_ERROR_LIMIT;
44
+ }
45
+
46
+ if ([dict objectForKey: kNRMA_REPORT_MAX_TRANSACTION_AGE ]) {
47
+
48
+ self.report_max_transaction_age = [[dict valueForKey: kNRMA_REPORT_MAX_TRANSACTION_AGE ] intValue ];
49
+ }
50
+ else {
51
+ self.report_max_transaction_age = NRMA_DEFAULT_MAX_TRANSACTION_AGE;
52
+ }
53
+ if ([dict objectForKey: kNRMA_REPORT_MAX_TRANSACTION_COUNT ]) {
54
+ self.report_max_transaction_count = [[dict valueForKey: kNRMA_REPORT_MAX_TRANSACTION_COUNT ]intValue];
55
+ }
56
+ else {
57
+ self.report_max_transaction_count = NRMA_DEFAULT_MAX_TRANSACTION_COUNT;
58
+ }
59
+
27
60
self.response_body_limit = [[dict valueForKey: kNRMA_RESPONSE_BODY_LIMIT ] intValue ];
28
61
self.server_timestamp = [[dict valueForKey: kNRMA_SERVER_TIMESTAMP ] longLongValue ];
29
62
self.stack_trace_limit = [[dict valueForKey: kNRMA_STACK_TRACE_LIMIT ] intValue ];
@@ -145,7 +178,9 @@ - (NSUInteger) hash
145
178
result = 31 * result + (unsigned int )self.account_id ;
146
179
result = 31 * result + (unsigned int )self.application_id ;
147
180
result = 31 * result + self.encoding_key .hash ;
148
-
181
+ // Is this a chill addition?
182
+ result = 31 * result + self.trusted_account_key .hash ;
183
+
149
184
return result;
150
185
}
151
186
@end
0 commit comments