@appmetrica/react-native-analytics 3.3.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/android/build.gradle +1 -1
  2. package/android/src/main/AndroidManifest.xml +4 -0
  3. package/android/src/main/AndroidManifestNew.xml +5 -0
  4. package/android/src/main/java/io/appmetrica/analytics/reactnative/AppMetricaModule.java +60 -6
  5. package/android/src/main/java/io/appmetrica/analytics/reactnative/AppMetricaPackage.java +1 -0
  6. package/android/src/main/java/io/appmetrica/analytics/reactnative/ExceptionSerializer.java +91 -0
  7. package/android/src/main/java/io/appmetrica/analytics/reactnative/ExternalAttributionSerializer.java +16 -9
  8. package/android/src/main/java/io/appmetrica/analytics/reactnative/ReactNativeDeferredDeeplinkListener.java +48 -0
  9. package/android/src/main/java/io/appmetrica/analytics/reactnative/ReactNativeDeferredDeeplinkParametersListener.java +53 -0
  10. package/android/src/main/java/io/appmetrica/analytics/reactnative/ReporterModule.java +130 -0
  11. package/android/src/main/java/io/appmetrica/analytics/reactnative/Utils.java +58 -2
  12. package/appmetrica-react-native-analytics.podspec +1 -1
  13. package/ios/AMARNAppMetrica.m +77 -7
  14. package/ios/AMARNAppMetricaUtils.h +1 -0
  15. package/ios/AMARNAppMetricaUtils.m +49 -0
  16. package/ios/AMARNExceptionSerializer.h +6 -0
  17. package/ios/AMARNExceptionSerializer.m +65 -0
  18. package/ios/AMARNReporter.h +6 -0
  19. package/ios/AMARNReporter.m +131 -0
  20. package/lib/commonjs/deferredDeeplink.js +2 -0
  21. package/lib/commonjs/deferredDeeplink.js.map +1 -0
  22. package/lib/commonjs/error.js +71 -0
  23. package/lib/commonjs/error.js.map +1 -0
  24. package/lib/commonjs/index.js +53 -1
  25. package/lib/commonjs/index.js.map +1 -1
  26. package/lib/commonjs/reporter.js +69 -0
  27. package/lib/commonjs/reporter.js.map +1 -0
  28. package/lib/commonjs/revenue.js +1 -0
  29. package/lib/commonjs/revenue.js.map +1 -1
  30. package/lib/module/deferredDeeplink.js +2 -0
  31. package/lib/module/deferredDeeplink.js.map +1 -0
  32. package/lib/module/error.js +63 -0
  33. package/lib/module/error.js.map +1 -0
  34. package/lib/module/index.js +42 -1
  35. package/lib/module/index.js.map +1 -1
  36. package/lib/module/reporter.js +62 -0
  37. package/lib/module/reporter.js.map +1 -0
  38. package/lib/module/revenue.js +1 -0
  39. package/lib/module/revenue.js.map +1 -1
  40. package/lib/typescript/src/deferredDeeplink.d.ts +10 -0
  41. package/lib/typescript/src/deferredDeeplink.d.ts.map +1 -0
  42. package/lib/typescript/src/error.d.ts +19 -0
  43. package/lib/typescript/src/error.d.ts.map +1 -0
  44. package/lib/typescript/src/index.d.ts +19 -1
  45. package/lib/typescript/src/index.d.ts.map +1 -1
  46. package/lib/typescript/src/reporter.d.ts +51 -0
  47. package/lib/typescript/src/reporter.d.ts.map +1 -0
  48. package/lib/typescript/src/revenue.d.ts +1 -0
  49. package/lib/typescript/src/revenue.d.ts.map +1 -1
  50. package/package.json +3 -1
  51. package/src/deferredDeeplink.ts +11 -0
  52. package/src/error.ts +87 -0
  53. package/src/index.ts +79 -2
  54. package/src/reporter.ts +126 -0
  55. package/src/revenue.ts +1 -0
@@ -5,6 +5,7 @@
5
5
  #import "AMARNUserProfileSerializer.h"
6
6
  #import "AMARNExternalAttribution.h"
7
7
  #import <AppMetricaCrashes/AppMetricaCrashes.h>
8
+ #import "AMARNExceptionSerializer.h"
8
9
 
9
10
  @implementation AMARNAppMetrica
10
11
 
@@ -38,9 +39,13 @@ RCT_EXPORT_METHOD(reportAppOpen:(NSString *)deeplink)
38
39
  [AMAAppMetrica trackOpeningURL:[NSURL URLWithString:deeplink]];
39
40
  }
40
41
 
41
- RCT_EXPORT_METHOD(reportError:(NSString *)identifier:(NSString *)message) {
42
- AMAError *error = [AMAError errorWithIdentifier:identifier message:message parameters:NULL];
43
- [[AMAAppMetricaCrashes crashes] reportError:error onFailure:nil];
42
+ RCT_EXPORT_METHOD(reportError:(NSString *)identifier:(NSString *)message:(NSDictionary *)_reason) {
43
+ [[[AMAAppMetricaCrashes crashes] pluginExtension] reportErrorWithIdentifier:identifier
44
+ message:message
45
+ details:amarn_exceptionForDictionary(_reason)
46
+ onFailure:^(NSError *error) {
47
+ NSLog(@"Failed to report error to AppMetrica: %@", [error localizedDescription]);
48
+ }];
44
49
  }
45
50
 
46
51
  RCT_EXPORT_METHOD(reportEvent:(NSString *)eventName:(NSDictionary *)attributes)
@@ -93,7 +98,7 @@ RCT_EXPORT_METHOD(setDataSendingEnabled:(BOOL)enabled)
93
98
 
94
99
  RCT_EXPORT_METHOD(reportECommerce:(NSDictionary *)ecommerceDict)
95
100
  {
96
- [AMAAppMetrica reportECommerce:[AMARNAppMetricaUtils ecommerceForDict:ecommerceDict] onFailure:nil];
101
+ [AMAAppMetrica reportECommerce:[AMARNAppMetricaUtils ecommerceForDict:ecommerceDict] onFailure:nil];
97
102
  }
98
103
 
99
104
  RCT_EXPORT_METHOD(setUserProfileID:(NSString *)userProfileID)
@@ -123,21 +128,86 @@ RCT_EXPORT_METHOD(putErrorEnvironmentValue:(NSString *)key:(NSString *)value)
123
128
 
124
129
  RCT_EXPORT_METHOD(reportExternalAttribution:(NSDictionary *)externalAttributionsDict)
125
130
  {
126
-
131
+
127
132
  NSString *sourceStr = externalAttributionsDict[@"source"];
128
133
  AMAAttributionSource source = amarn_getExternalAttributionSource(sourceStr);
129
134
  if (source == nil) {
130
135
  NSLog(@"Failed to report external attribution to AppMetrica. Unknown source %@", sourceStr);
131
136
  return;
132
137
  }
133
-
138
+
134
139
  NSDictionary *value = externalAttributionsDict[@"value"];
135
-
140
+
136
141
  [AMAAppMetrica reportExternalAttribution:value source:source onFailure:^(NSError *error) {
137
142
  NSLog(@"Failed to report external attribution to AppMetrica: %@", [error localizedDescription]);
138
143
  }];
139
144
  }
140
145
 
146
+ RCT_EXPORT_METHOD(reportErrorWithoutIdentifier:(NSString *)message:(NSDictionary *)error)
147
+ {
148
+ AMAPluginErrorDetails *details = amarn_exceptionForDictionary(error);
149
+ if (details.backtrace.count == 0) {
150
+ [[[AMAAppMetricaCrashes crashes] pluginExtension] reportErrorWithIdentifier:@"Errors without stacktrace"
151
+ message:message
152
+ details:details
153
+ onFailure:^(NSError *error) {
154
+ NSLog(@"Failed to report error to AppMetrica: %@", [error localizedDescription]);
155
+ }];
156
+ } else {
157
+ [[[AMAAppMetricaCrashes crashes] pluginExtension] reportError:details message:message onFailure:^(NSError *error) {
158
+ NSLog(@"Failed to report error to AppMetrica: %@", [error localizedDescription]);
159
+ }];
160
+ }
161
+ }
162
+
163
+ RCT_EXPORT_METHOD(reportUnhandledException:(NSDictionary *)error)
164
+ {
165
+ [[[AMAAppMetricaCrashes crashes] pluginExtension] reportUnhandledException:amarn_exceptionForDictionary(error)
166
+ onFailure:^(NSError *error) {
167
+ NSLog(@"Failed to report unhandled exception to AppMetrica: %@", [error localizedDescription]);
168
+ }];
169
+ }
170
+
171
+ RCT_EXPORT_METHOD(putAppEnvironmentValue:(NSString *)key:(NSString *)value)
172
+ {
173
+ [AMAAppMetrica setAppEnvironmentValue:value forKey:key];
174
+ }
175
+
176
+ RCT_EXPORT_METHOD(clearAppEnvironment)
177
+ {
178
+ [AMAAppMetrica clearAppEnvironment];
179
+ }
180
+
181
+ RCT_EXPORT_METHOD(activateReporter:(NSDictionary *)configDict)
182
+ {
183
+ [AMAAppMetrica activateReporterWithConfiguration:[AMARNAppMetricaUtils reporterConfigurationForDictionary:configDict]];
184
+ }
185
+
186
+ RCT_EXPORT_METHOD(touchReporter:(NSString *)apiKey)
187
+ {
188
+ [AMAAppMetrica reporterForAPIKey:apiKey];
189
+ }
190
+
191
+ RCT_EXPORT_METHOD(getDeviceId:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
192
+ {
193
+ resolve([AMAAppMetrica deviceID]);
194
+ }
195
+
196
+ RCT_EXPORT_METHOD(getUuid:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
197
+ {
198
+ resolve([AMAAppMetrica UUID]);
199
+ }
200
+
201
+ RCT_EXPORT_METHOD(requestDeferredDeeplink:(RCTResponseSenderBlock)onFailure:(RCTResponseSenderBlock)onSuccess)
202
+ {
203
+ // It does nothing for iOS
204
+ }
205
+
206
+ RCT_EXPORT_METHOD(requestDeferredDeeplinkParameters:(RCTResponseSenderBlock)onFailure:(RCTResponseSenderBlock)onSuccess)
207
+ {
208
+ // It does nothing for iOS
209
+ }
210
+
141
211
  - (NSObject *)wrap:(NSObject *)value
142
212
  {
143
213
  if (value == nil) {
@@ -22,5 +22,6 @@
22
22
  + (AMAAdType)toAdType:(NSString *)type;
23
23
  + (NSDictionary *)convertRevenueInfoPayload:(NSString *)payload;
24
24
  + (AMAUserProfile *)userProfileForDict:(NSDictionary *)userProfileDict;
25
+ + (AMAMutableReporterConfiguration *)reporterConfigurationForDictionary:(NSDictionary *)configDict;
25
26
 
26
27
  @end
@@ -43,6 +43,18 @@
43
43
  if (configDict[@"userProfileID"] != nil) {
44
44
  configuration.userProfileID = configDict[@"userProfileID"];
45
45
  }
46
+ if (configDict[@"appEnvironment"] != nil) {
47
+ NSDictionary *appEnvironmentMap = configDict[@"appEnvironment"];
48
+ for (NSString *key in appEnvironmentMap) {
49
+ [AMAAppMetrica setAppEnvironmentValue:appEnvironmentMap[key] forKey:key];
50
+ }
51
+ }
52
+ if (configDict[@"maxReportsCount"] != nil) {
53
+ configuration.maxReportsCount = [configDict[@"maxReportsCount"] unsignedIntegerValue];
54
+ }
55
+ if (configDict[@"dispatchPeriodSeconds"] != nil) {
56
+ configuration.dispatchPeriod = [configDict[@"dispatchPeriodSeconds"] unsignedIntegerValue];
57
+ }
46
58
 
47
59
  return configuration;
48
60
  }
@@ -353,6 +365,9 @@
353
365
  if ([type isEqualToString:@"rewarded"]){
354
366
  return AMAAdTypeRewarded;
355
367
  }
368
+ if ([type isEqualToString:@"app_open"]){
369
+ return AMAAdTypeAppOpen;
370
+ }
356
371
  if ([type isEqualToString:@"other"]){
357
372
  return AMAAdTypeOther;
358
373
  }
@@ -379,4 +394,38 @@
379
394
  return amarn_deserializeUserProfile(userProfileDict);
380
395
  }
381
396
 
397
+ + (AMAMutableReporterConfiguration *)reporterConfigurationForDictionary:(NSDictionary *)configDict
398
+ {
399
+ NSString *apiKey = configDict[@"apiKey"];
400
+ AMAMutableReporterConfiguration *configuration = [[AMAMutableReporterConfiguration alloc] initWithAPIKey:apiKey];
401
+ if (configDict[@"logs"] != nil) {
402
+ configuration.logsEnabled = [configDict[@"logs"] boolValue];
403
+ }
404
+ if (configDict[@"maxReportsInDatabaseCount"] != nil) {
405
+ configuration.maxReportsInDatabaseCount = [configDict[@"maxReportsInDatabaseCount"] unsignedIntegerValue];
406
+ }
407
+ if (configDict[@"sessionTimeout"] != nil) {
408
+ configuration.sessionTimeout = [configDict[@"sessionTimeout"] unsignedIntegerValue];
409
+ }
410
+ if (configDict[@"dataSendingEnabled"] != nil) {
411
+ configuration.dataSendingEnabled = [configDict[@"dataSendingEnabled"] boolValue];
412
+ }
413
+ if (configDict[@"appEnvironment"] != nil) {
414
+ NSDictionary *appEnvironmentMap = configDict[@"appEnvironment"];
415
+ for (NSString *key in appEnvironmentMap) {
416
+ [AMAAppMetrica setAppEnvironmentValue:appEnvironmentMap[key] forKey:key];
417
+ }
418
+ }
419
+ if (configDict[@"userProfileID"] != nil) {
420
+ configuration.userProfileID = configDict[@"userProfileID"];
421
+ }
422
+ if (configDict[@"dispatchPeriodSeconds"] != nil) {
423
+ configuration.dispatchPeriod = [configDict[@"dispatchPeriodSeconds"] unsignedIntegerValue];
424
+ }
425
+ if (configDict[@"maxReportsCount"] != nil) {
426
+ configuration.maxReportsCount = [configDict[@"maxReportsCount"] unsignedIntegerValue];
427
+ }
428
+ return configuration;
429
+ }
430
+
382
431
  @end
@@ -0,0 +1,6 @@
1
+
2
+ #import <AppMetricaCrashes/AppMetricaCrashes.h>
3
+
4
+ @class AMARNExceptionSerializer;
5
+
6
+ AMAPluginErrorDetails *amarn_exceptionForDictionary(NSDictionary * configDict);
@@ -0,0 +1,65 @@
1
+
2
+ #import "AMARNExceptionSerializer.h"
3
+
4
+ NSNumber *amarn_parseNumber(NSString *string)
5
+ {
6
+ NSNumberFormatter *format = [[NSNumberFormatter alloc] init];
7
+ format.numberStyle = NSNumberFormatterDecimalStyle;
8
+ NSNumber *myNumber = [format numberFromString:string];
9
+ return myNumber;
10
+ }
11
+
12
+ AMAStackTraceElement *amarn_deserializeTraceItem(NSDictionary *traceDict)
13
+ {
14
+ AMAStackTraceElement *item = [[AMAStackTraceElement alloc] init];
15
+ if (traceDict[@"fileName"] != nil) {
16
+ item.fileName = traceDict[@"fileName"];
17
+ }
18
+ if (traceDict[@"className"] != nil) {
19
+ item.className = traceDict[@"className"];
20
+ }
21
+ if (traceDict[@"methodName"] != nil) {
22
+ item.methodName = traceDict[@"methodName"];
23
+ }
24
+ if (traceDict[@"line"] != nil) {
25
+ item.line = amarn_parseNumber(traceDict[@"line"]);
26
+ }
27
+ if (traceDict[@"column"] != nil) {
28
+ item.column = amarn_parseNumber(traceDict[@"column"]);
29
+ }
30
+ return item;
31
+ }
32
+
33
+ NSArray<AMAStackTraceElement *> *amarn_deserializeStackTrace(NSArray *frames)
34
+ {
35
+ NSMutableArray<AMAStackTraceElement *> *items = [[NSMutableArray alloc] init];
36
+ for (NSDictionary *frameDict in frames) {
37
+ [items addObject:amarn_deserializeTraceItem(frameDict)];
38
+ }
39
+ return items;
40
+ }
41
+
42
+ AMAPluginErrorDetails *amarn_exceptionForDictionary(NSDictionary *configDict)
43
+ {
44
+ if (configDict == nil) {
45
+ return nil;
46
+ }
47
+ AMAPluginErrorDetails *error = [[AMAPluginErrorDetails alloc] init];
48
+ error.platform = kAMAPlatformReactNative;
49
+ if (configDict[@"errorName"] != nil) {
50
+ error.exceptionClass = configDict[@"errorName"];
51
+ }
52
+ if (configDict[@"message"] != nil) {
53
+ error.message = configDict[@"message"];
54
+ }
55
+ if (configDict[@"stackTrace"] != nil) {
56
+ error.backtrace = amarn_deserializeStackTrace(configDict[@"stackTrace"]);
57
+ }
58
+ if (configDict[@"virtualMachineVersion"] != nil) {
59
+ error.virtualMachineVersion = configDict[@"virtualMachineVersion"];
60
+ }
61
+ if (configDict[@"pluginEnvironment"] != nil) {
62
+ error.pluginEnvironment = configDict[@"pluginEnvironment"];
63
+ }
64
+ return error;
65
+ }
@@ -0,0 +1,6 @@
1
+
2
+ #import <React/RCTBridgeModule.h>
3
+
4
+ @interface AMARNReporter : NSObject <RCTBridgeModule>
5
+
6
+ @end
@@ -0,0 +1,131 @@
1
+
2
+ #import "AMARNReporter.h"
3
+ #import "AMARNAppMetricaUtils.h"
4
+ #import <AppMetricaCore/AppMetricaCore.h>
5
+ #import <AppMetricaCrashes/AppMetricaCrashes.h>
6
+ #import "AMARNUserProfileSerializer.h"
7
+ #import "AMARNExceptionSerializer.h"
8
+
9
+ @implementation AMARNReporter
10
+
11
+ RCT_EXPORT_MODULE(AppMetricaReporter)
12
+
13
+ RCT_EXPORT_METHOD(reportError:(NSString *)apiKey:(NSString *)identifier:(NSString *)message:(NSDictionary *)_reason)
14
+ {
15
+ id<AMAAppMetricaCrashReporting> reporter = [[AMAAppMetricaCrashes crashes] reporterForAPIKey:apiKey];
16
+ [[reporter pluginExtension] reportErrorWithIdentifier:identifier
17
+ message:message
18
+ details:amarn_exceptionForDictionary(_reason)
19
+ onFailure:^(NSError *error) {
20
+ NSLog(@"Failed to report error to AppMetrica: %@", [error localizedDescription]);
21
+ }];
22
+ }
23
+
24
+ RCT_EXPORT_METHOD(reportErrorWithoutIdentifier:(NSString *)apiKey:(NSString *)message:(NSDictionary *)error)
25
+ {
26
+ id<AMAAppMetricaCrashReporting> reporter = [[AMAAppMetricaCrashes crashes] reporterForAPIKey:apiKey];
27
+ AMAPluginErrorDetails *details = amarn_exceptionForDictionary(error);
28
+ if (details.backtrace.count == 0) {
29
+ [[reporter pluginExtension] reportErrorWithIdentifier:@"Errors without stacktrace"
30
+ message:message
31
+ details:details
32
+ onFailure:^(NSError *error) {
33
+ NSLog(@"Failed to report error to AppMetrica: %@", [error localizedDescription]);
34
+ }];
35
+ } else {
36
+ [[reporter pluginExtension] reportError:details message:message onFailure:^(NSError *error) {
37
+ NSLog(@"Failed to report error to AppMetrica: %@", [error localizedDescription]);
38
+ }];
39
+ }
40
+ }
41
+
42
+ RCT_EXPORT_METHOD(reportUnhandledException:(NSString *)apiKey:(NSDictionary *)error)
43
+ {
44
+ id<AMAAppMetricaCrashReporting> reporter = [[AMAAppMetricaCrashes crashes] reporterForAPIKey:apiKey];
45
+ [[reporter pluginExtension] reportUnhandledException:amarn_exceptionForDictionary(error)
46
+ onFailure:^(NSError *error) {
47
+ NSLog(@"Failed to report unhandled exception to AppMetrica: %@", [error localizedDescription]);
48
+ }];
49
+ }
50
+
51
+ RCT_EXPORT_METHOD(reportEvent:(NSString *)apiKey:(NSString *)eventName:(NSDictionary *)attributes)
52
+ {
53
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
54
+ if (attributes == nil) {
55
+ [reporter reportEvent:eventName onFailure:^(NSError *error) {
56
+ NSLog(@"error: %@", [error localizedDescription]);
57
+ }];
58
+ } else {
59
+ [reporter reportEvent:eventName parameters:attributes onFailure:^(NSError *error) {
60
+ NSLog(@"error: %@", [error localizedDescription]);
61
+ }];
62
+ }
63
+ }
64
+
65
+ RCT_EXPORT_METHOD(pauseSession:(NSString *)apiKey)
66
+ {
67
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
68
+ [reporter pauseSession];
69
+ }
70
+
71
+ RCT_EXPORT_METHOD(resumeSession:(NSString *)apiKey)
72
+ {
73
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
74
+ [reporter resumeSession];
75
+ }
76
+
77
+ RCT_EXPORT_METHOD(sendEventsBuffer:(NSString *)apiKey)
78
+ {
79
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
80
+ [reporter sendEventsBuffer];
81
+ }
82
+
83
+ RCT_EXPORT_METHOD(putAppEnvironmentValue:(NSString *)apiKey:(NSString *)key:(NSString *)value)
84
+ {
85
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
86
+ [reporter setAppEnvironmentValue:value forKey:key];
87
+ }
88
+
89
+ RCT_EXPORT_METHOD(clearAppEnvironment:(NSString *)apiKey)
90
+ {
91
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
92
+ [reporter clearAppEnvironment];
93
+ }
94
+
95
+ RCT_EXPORT_METHOD(setUserProfileID:(NSString *)apiKey:(NSString *)userProfileID)
96
+ {
97
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
98
+ [reporter setUserProfileID:userProfileID];
99
+ }
100
+
101
+ RCT_EXPORT_METHOD(setDataSendingEnabled:(NSString *)apiKey:(BOOL)enabled)
102
+ {
103
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
104
+ [reporter setDataSendingEnabled:enabled];
105
+ }
106
+
107
+ RCT_EXPORT_METHOD(reportUserProfile:(NSString *)apiKey:(NSDictionary *)userProfileDict)
108
+ {
109
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
110
+ [reporter reportUserProfile:[AMARNAppMetricaUtils userProfileForDict:userProfileDict] onFailure:nil];
111
+ }
112
+
113
+ RCT_EXPORT_METHOD(reportRevenue:(NSString *)apiKey:(NSDictionary *)revenueDict)
114
+ {
115
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
116
+ [reporter reportRevenue:[AMARNAppMetricaUtils revenueForDict:revenueDict] onFailure:nil];
117
+ }
118
+
119
+ RCT_EXPORT_METHOD(reportAdRevenue:(NSString *)apiKey:(NSDictionary *)revenueDict)
120
+ {
121
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
122
+ [reporter reportAdRevenue:[AMARNAppMetricaUtils adRevenueForDict:revenueDict] onFailure:nil];
123
+ }
124
+
125
+ RCT_EXPORT_METHOD(reportECommerce:(NSString *)apiKey:(NSDictionary *)ecommerceDict)
126
+ {
127
+ id<AMAAppMetricaReporting> reporter = [AMAAppMetrica reporterForAPIKey:apiKey];
128
+ [reporter reportECommerce:[AMARNAppMetricaUtils ecommerceForDict:ecommerceDict] onFailure:nil];
129
+ }
130
+
131
+ @end
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=deferredDeeplink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["deferredDeeplink.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AppMetricaError = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ const traceRegex = /^\s*at (.*?) ?\((.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
11
+ function parseTraceLine(line) {
12
+ const parts = traceRegex.exec(line);
13
+ if (parts === null) {
14
+ return undefined;
15
+ }
16
+ return {
17
+ fileName: parts[2],
18
+ methodName: parts[1],
19
+ column: parts[3],
20
+ line: parts[4]
21
+ };
22
+ }
23
+ function getRNVersion() {
24
+ const versions = _reactNative.Platform.constants.reactNativeVersion;
25
+ return versions.major + '.' + versions.minor + '.' + versions.patch;
26
+ }
27
+ function getReactVersion() {
28
+ return _react.default.version;
29
+ }
30
+ function getPluginEnvironment() {
31
+ return {
32
+ reactVersion: getReactVersion()
33
+ };
34
+ }
35
+ function parseStackTrace(stackTrace) {
36
+ if (stackTrace === undefined) {
37
+ return undefined;
38
+ }
39
+ try {
40
+ const lines = stackTrace.split('\n');
41
+ const array = [];
42
+ lines === null || lines === void 0 || lines.forEach(line => {
43
+ const item = parseTraceLine(line);
44
+ if (item !== undefined) {
45
+ array.push(item);
46
+ }
47
+ });
48
+ return array;
49
+ } catch (e) {
50
+ console.log(e);
51
+ return undefined;
52
+ }
53
+ }
54
+ class AppMetricaError {
55
+ constructor(errorName, message) {
56
+ this.errorName = errorName;
57
+ this.message = message;
58
+ this.pluginEnvironment = getPluginEnvironment();
59
+ this.virtualMachineVersion = getRNVersion();
60
+ }
61
+ static withError(error) {
62
+ const newError = new AppMetricaError(error.name, error.message);
63
+ newError.stackTrace = parseStackTrace(error.stack);
64
+ return newError;
65
+ }
66
+ static withObject(error) {
67
+ return new AppMetricaError(undefined, JSON.stringify(error));
68
+ }
69
+ }
70
+ exports.AppMetricaError = AppMetricaError;
71
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","e","__esModule","default","traceRegex","parseTraceLine","line","parts","exec","undefined","fileName","methodName","column","getRNVersion","versions","Platform","constants","reactNativeVersion","major","minor","patch","getReactVersion","React","version","getPluginEnvironment","reactVersion","parseStackTrace","stackTrace","lines","split","array","forEach","item","push","console","log","AppMetricaError","constructor","errorName","message","pluginEnvironment","virtualMachineVersion","withError","error","newError","name","stack","withObject","JSON","stringify","exports"],"sourceRoot":"../../src","sources":["error.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA0B,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1B,MAAMG,UAAU,GAAG,qDAAqD;AAExE,SAASC,cAAcA,CAACC,IAAY,EAA8B;EAChE,MAAMC,KAAK,GAAGH,UAAU,CAACI,IAAI,CAACF,IA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AM2B,eAAe,CAAC;EAO3BC,WAAWA,CAACC,SAAkB,EAAEC,OAAgB,EAAE;IAChD,IAAI,CAACD,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,iBAAiB,GAAGhB,oBAAoB,CAAC,CAAC;IAC/C,IAAI,CAACiB,qBAAqB,GAAG5B,YAAY,CAAC,CAAC;EAC7C;EAEA,OAAO6B,SAASA,CAACC,KAAY,EAAmB;IAC9C,MAAMC,QAAQ,GAAG,IAAIR,eAAe,CAACO,KAAK,CAACE,IAAI,EAAEF,KAAK,CAACJ,OAAO,CAAC;IAC/DK,QAAQ,CAACjB,UAAU,GAAGD,eAAe,CAACiB,KAAK,CAACG,KAAK,CAAC;IAClD,OAAOF,QAAQ;EACjB;EAEA,OAAOG,UAAUA,CAACJ,KAAc,EAAmB;IACjD,OAAO,IAAIP,eAAe,CAAC3B,SAAS,EAAEuC,IAAI,CAACC,SAAS,CAACN,KAAK,CAAC,CAAC;EAC9D;AACF;AAACO,OAAA,CAAAd,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -11,6 +11,8 @@ var _exportNames = {
11
11
  exports.default = exports.UUID_KEY = exports.DEVICE_ID_KEY = exports.DEVICE_ID_HASH_KEY = void 0;
12
12
  var _reactNative = require("react-native");
13
13
  var _utils = require("./utils");
14
+ var _error = require("./error");
15
+ var _reporter = require("./reporter");
14
16
  var _ecommerce = require("./ecommerce");
15
17
  Object.keys(_ecommerce).forEach(function (key) {
16
18
  if (key === "default" || key === "__esModule") return;
@@ -59,6 +61,18 @@ Object.keys(_externalAttribution).forEach(function (key) {
59
61
  }
60
62
  });
61
63
  });
64
+ var _deferredDeeplink = require("./deferredDeeplink");
65
+ Object.keys(_deferredDeeplink).forEach(function (key) {
66
+ if (key === "default" || key === "__esModule") return;
67
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
68
+ if (key in exports && exports[key] === _deferredDeeplink[key]) return;
69
+ Object.defineProperty(exports, key, {
70
+ enumerable: true,
71
+ get: function () {
72
+ return _deferredDeeplink[key];
73
+ }
74
+ });
75
+ });
62
76
  const LINKING_ERROR = `The package '@appmetrica/react-native-analytics' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
63
77
  ios: "- You have run 'pod install'\n",
64
78
  default: ''
@@ -86,6 +100,7 @@ const DEVICE_ID_HASH_KEY = exports.DEVICE_ID_HASH_KEY = 'appmetrica_device_id_ha
86
100
  const DEVICE_ID_KEY = exports.DEVICE_ID_KEY = 'appmetrica_device_id';
87
101
  const UUID_KEY = exports.UUID_KEY = 'appmetrica_uuid';
88
102
  class AppMetrica {
103
+ static reporters = new Map();
89
104
  static activate(config) {
90
105
  if (!activated) {
91
106
  AppMetricaNative.activate(config);
@@ -110,7 +125,13 @@ class AppMetrica {
110
125
  AppMetricaNative.reportAppOpen(deeplink);
111
126
  }
112
127
  static reportError(identifier, message, _reason) {
113
- AppMetricaNative.reportError(identifier, message);
128
+ AppMetricaNative.reportError(identifier, message, _reason instanceof Error ? _error.AppMetricaError.withError(_reason) : _error.AppMetricaError.withObject(_reason));
129
+ }
130
+ static reportUnhandledException(error) {
131
+ AppMetricaNative.reportUnhandledException(_error.AppMetricaError.withError(error));
132
+ }
133
+ static reportErrorWithoutIdentifier(message, error) {
134
+ AppMetricaNative.reportErrorWithoutIdentifier(message, _error.AppMetricaError.withError(error));
114
135
  }
115
136
  static reportEvent(eventName, attributes) {
116
137
  AppMetricaNative.reportEvent(eventName, attributes);
@@ -154,6 +175,37 @@ class AppMetrica {
154
175
  static reportExternalAttribution(attribution) {
155
176
  AppMetricaNative.reportExternalAttribution(attribution);
156
177
  }
178
+ static putAppEnvironmentValue(key, value) {
179
+ AppMetricaNative.putAppEnvironmentValue(key, value);
180
+ }
181
+ static clearAppEnvironment() {
182
+ AppMetricaNative.clearAppEnvironment();
183
+ }
184
+ static getReporter(apiKey) {
185
+ if (AppMetrica.reporters.has(apiKey)) {
186
+ return AppMetrica.reporters.get(apiKey);
187
+ } else {
188
+ AppMetricaNative.touchReporter(apiKey);
189
+ const reporter = new _reporter.Reporter(apiKey);
190
+ AppMetrica.reporters.set(apiKey, reporter);
191
+ return reporter;
192
+ }
193
+ }
194
+ static activateReporter(config) {
195
+ AppMetricaNative.activateReporter(config);
196
+ }
197
+ static getDeviceId() {
198
+ return AppMetricaNative.getDeviceId();
199
+ }
200
+ static getUuid() {
201
+ return AppMetricaNative.getUuid();
202
+ }
203
+ static requestDeferredDeeplink(listener) {
204
+ AppMetricaNative.requestDeferredDeeplink(listener.onFailure, listener.onSuccess);
205
+ }
206
+ static requestDeferredDeeplinkParameters(listener) {
207
+ AppMetricaNative.requestDeferredDeeplinkParameters(listener.onFailure, listener.onSuccess);
208
+ }
157
209
  }
158
210
  exports.default = AppMetrica;
159
211
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_utils","_ecommerce","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_revenue","_userProfile","_externalAttribution","LINKING_ERROR","Platform","select","ios","default","AppMetricaNative","NativeModules","AppMetrica","Proxy","Error","activated","appOpenTracking","getUrlAsync","initialUrl","Linking","getInitialURL","reportAppOpen","callback","event","url","addEventListener","DEVICE_ID_HASH_KEY","DEVICE_ID_KEY","UUID_KEY","activate","config","appOpenTrackingEnabled","getLibraryApiLevel","getLibraryVersion","pauseSession","deeplink","reportError","identifier","message","_reason","reportEvent","eventName","attributes","requestStartupParams","listener","identifiers","resumeSession","sendEventsBuffer","setLocation","location","setLocationTracking","enabled","setDataSendingEnabled","setUserProfileID","userProfileID","reportECommerce","reportRevenue","revenue","reportAdRevenue","adRevenue","normalizeAdRevenue","reportUserProfile","userProfile","putErrorEnvironmentValue","value","reportExternalAttribution","attribution"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAA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BAAgB,CAACqD,wBAAwB,CAACtE,GAAG,EAAEuE,KAAK,CAAC;EACvD;EAEA,OAAOC,yBAAyBA,CAACC,WAAgC,EAAE;IACjExD,gBAAgB,CAACuD,yBAAyB,CAACC,WAAW,CAAC;EACzD;AACF;AAACpE,OAAA,CAAAW,OAAA,GAAAG,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNative","require","_utils","_error","_reporter","_ecommerce","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_revenue","_userProfile","_externalAttribution","_deferredDeeplink","LINKING_ERROR","Platform","select","ios","default","AppMetricaNative","NativeModules","AppMetrica","Proxy","Error","activated","appOpenTracking","getUrlAsync","initialUrl","Linking","getInitialURL","reportAppOpen","callback","event","url","addEventListener","DEVICE_ID_HASH_KEY","DEVICE_ID_KEY","UUID_KEY","reporters","Map","activate","config","appOpenTrackingEnabled","getLibraryApiLevel","getLibraryVersion","pauseSession","deeplink","reportError","identifier","message","_reason","AppMetricaError","withError","withObject","reportUnhandledException","error","reportErrorWithoutIdentifier","reportEvent","eventName","attributes","requestStartupParams","listener","identifiers","resumeSession","sendEventsBuffer","setLocation","location","setLocationTracking","enabled","setDataSendingEnabled","setUserProfileID","userProfileID","reportECommerce","reportRevenue","revenue","reportAdRevenue","adRevenue","normalizeAdRevenue","reportUserProfile","userProfile","putErrorEnvironmentValue","value","reportExternalAttribution","attribution","putAppEnvironmentValue","clearAppEnvironment","getReporter","apiKey","has","touchReporter","reporter","Reporter","set","activateReporter","getDeviceId","getUuid","requestDeferredDeeplink","onFailure","onSuccess","requestDeferredDeeplinkParameters"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AA+FA,IAAAI,UAAA,GAAAJ,OAAA;AAAAK,MAA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