@appmetrica/react-native-analytics 3.2.0 → 3.3.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.
- package/android/src/main/java/io/appmetrica/analytics/reactnative/AppMetricaModule.java +13 -1
- package/android/src/main/java/io/appmetrica/analytics/reactnative/ExternalAttributionSerializer.java +37 -0
- package/ios/AMARNAppMetrica.m +18 -0
- package/ios/AMARNExternalAttribution.h +4 -0
- package/ios/AMARNExternalAttribution.m +28 -0
- package/lib/commonjs/externalAttribution.js +46 -0
- package/lib/commonjs/externalAttribution.js.map +1 -0
- package/lib/commonjs/index.js +15 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/externalAttribution.js +39 -0
- package/lib/module/externalAttribution.js.map +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/externalAttribution.d.ts +15 -0
- package/lib/typescript/src/externalAttribution.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/externalAttribution.ts +56 -0
- package/src/index.ts +8 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
package io.appmetrica.analytics.reactnative;
|
|
2
2
|
|
|
3
|
-
import android.
|
|
3
|
+
import android.text.TextUtils;
|
|
4
4
|
import android.util.Log;
|
|
5
5
|
import androidx.annotation.NonNull;
|
|
6
6
|
import com.facebook.react.bridge.Callback;
|
|
@@ -12,8 +12,12 @@ import com.facebook.react.bridge.ReadableArray;
|
|
|
12
12
|
import com.facebook.react.bridge.ReadableMap;
|
|
13
13
|
import com.facebook.react.module.annotations.ReactModule;
|
|
14
14
|
|
|
15
|
+
import java.util.Iterator;
|
|
16
|
+
import java.util.Map;
|
|
17
|
+
|
|
15
18
|
import io.appmetrica.analytics.AppMetrica;
|
|
16
19
|
import io.appmetrica.analytics.AppMetricaConfig;
|
|
20
|
+
import io.appmetrica.analytics.ModulesFacade;
|
|
17
21
|
import io.appmetrica.analytics.ecommerce.ECommerceEvent;
|
|
18
22
|
|
|
19
23
|
@ReactModule(name = AppMetricaModule.NAME)
|
|
@@ -151,4 +155,12 @@ public class AppMetricaModule extends ReactContextBaseJavaModule {
|
|
|
151
155
|
public void putErrorEnvironmentValue(String key, String value) {
|
|
152
156
|
AppMetrica.putErrorEnvironmentValue(key, value);
|
|
153
157
|
}
|
|
158
|
+
|
|
159
|
+
@ReactMethod
|
|
160
|
+
public void reportExternalAttribution(ReadableMap attribution) {
|
|
161
|
+
ModulesFacade.reportExternalAttribution(
|
|
162
|
+
ExternalAttributionSerializer.parseSource(attribution.getString("source")),
|
|
163
|
+
ExternalAttributionSerializer.parseValue(attribution.getMap("value"))
|
|
164
|
+
);
|
|
165
|
+
}
|
|
154
166
|
}
|
package/android/src/main/java/io/appmetrica/analytics/reactnative/ExternalAttributionSerializer.java
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
package io.appmetrica.analytics.reactnative;
|
|
2
|
+
|
|
3
|
+
import android.text.TextUtils;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
6
|
+
|
|
7
|
+
import org.json.JSONObject;
|
|
8
|
+
|
|
9
|
+
import io.appmetrica.analytics.ModulesFacade;
|
|
10
|
+
|
|
11
|
+
final class ExternalAttributionSerializer {
|
|
12
|
+
private ExternalAttributionSerializer() {}
|
|
13
|
+
|
|
14
|
+
public static int parseSource(String sourceString) {
|
|
15
|
+
if (TextUtils.isEmpty(sourceString)) {
|
|
16
|
+
return -1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return switch (sourceString) {
|
|
20
|
+
case "AppsFlyer" -> ModulesFacade.EXTERNAL_ATTRIBUTION_APPSFLYER;
|
|
21
|
+
case "Adjust" -> ModulesFacade.EXTERNAL_ATTRIBUTION_ADJUST;
|
|
22
|
+
case "Kochava" -> ModulesFacade.EXTERNAL_ATTRIBUTION_KOCHAVA;
|
|
23
|
+
case "Tenjin" -> ModulesFacade.EXTERNAL_ATTRIBUTION_TENJIN;
|
|
24
|
+
case "Airbridge" -> ModulesFacade.EXTERNAL_ATTRIBUTION_AIRBRIDGE;
|
|
25
|
+
case "Singular" -> ModulesFacade.EXTERNAL_ATTRIBUTION_SINGULAR;
|
|
26
|
+
default -> -1;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public static String parseValue(ReadableMap valueMap) {
|
|
31
|
+
if (valueMap == null) {
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return new JSONObject(valueMap.toHashMap()).toString();
|
|
36
|
+
}
|
|
37
|
+
}
|
package/ios/AMARNAppMetrica.m
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
#import "AMARNAppMetricaUtils.h"
|
|
4
4
|
#import "AMARNStartupParamsUtils.h"
|
|
5
5
|
#import "AMARNUserProfileSerializer.h"
|
|
6
|
+
#import "AMARNExternalAttribution.h"
|
|
6
7
|
#import <AppMetricaCrashes/AppMetricaCrashes.h>
|
|
7
8
|
|
|
8
9
|
@implementation AMARNAppMetrica
|
|
@@ -120,6 +121,23 @@ RCT_EXPORT_METHOD(putErrorEnvironmentValue:(NSString *)key:(NSString *)value)
|
|
|
120
121
|
[[AMAAppMetricaCrashes crashes] setErrorEnvironmentValue:value forKey:key];
|
|
121
122
|
}
|
|
122
123
|
|
|
124
|
+
RCT_EXPORT_METHOD(reportExternalAttribution:(NSDictionary *)externalAttributionsDict)
|
|
125
|
+
{
|
|
126
|
+
|
|
127
|
+
NSString *sourceStr = externalAttributionsDict[@"source"];
|
|
128
|
+
AMAAttributionSource source = amarn_getExternalAttributionSource(sourceStr);
|
|
129
|
+
if (source == nil) {
|
|
130
|
+
NSLog(@"Failed to report external attribution to AppMetrica. Unknown source %@", sourceStr);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
NSDictionary *value = externalAttributionsDict[@"value"];
|
|
135
|
+
|
|
136
|
+
[AMAAppMetrica reportExternalAttribution:value source:source onFailure:^(NSError *error) {
|
|
137
|
+
NSLog(@"Failed to report external attribution to AppMetrica: %@", [error localizedDescription]);
|
|
138
|
+
}];
|
|
139
|
+
}
|
|
140
|
+
|
|
123
141
|
- (NSObject *)wrap:(NSObject *)value
|
|
124
142
|
{
|
|
125
143
|
if (value == nil) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
#include "AMARNExternalAttribution.h"
|
|
3
|
+
|
|
4
|
+
AMAAttributionSource amarn_getExternalAttributionSource(NSString *sourceStr)
|
|
5
|
+
{
|
|
6
|
+
if (sourceStr == nil) return nil;
|
|
7
|
+
|
|
8
|
+
if ([sourceStr isEqualToString:@"AppsFlyer"]) {
|
|
9
|
+
return kAMAAttributionSourceAppsflyer;
|
|
10
|
+
}
|
|
11
|
+
if ([sourceStr isEqualToString:@"Adjust"]) {
|
|
12
|
+
return kAMAAttributionSourceAdjust;
|
|
13
|
+
}
|
|
14
|
+
if ([sourceStr isEqualToString:@"Kochava"]) {
|
|
15
|
+
return kAMAAttributionSourceKochava;
|
|
16
|
+
}
|
|
17
|
+
if ([sourceStr isEqualToString:@"Tenjin"]) {
|
|
18
|
+
return kAMAAttributionSourceTenjin;
|
|
19
|
+
}
|
|
20
|
+
if ([sourceStr isEqualToString:@"Airbridge"]) {
|
|
21
|
+
return kAMAAttributionSourceAirbridge;
|
|
22
|
+
}
|
|
23
|
+
if ([sourceStr isEqualToString:@"Singular"]) {
|
|
24
|
+
return kAMAAttributionSourceSingular;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return nil;
|
|
28
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ExternalAttributions = void 0;
|
|
7
|
+
class ExternalAttributions {
|
|
8
|
+
static adjust(data) {
|
|
9
|
+
return {
|
|
10
|
+
source: 'Adjust',
|
|
11
|
+
value: data
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
static airbridge(data) {
|
|
15
|
+
return {
|
|
16
|
+
source: 'Airbridge',
|
|
17
|
+
value: data
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static appsflyer(data) {
|
|
21
|
+
return {
|
|
22
|
+
source: 'AppsFlyer',
|
|
23
|
+
value: data.data
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
static kochava(data) {
|
|
27
|
+
return {
|
|
28
|
+
source: 'Kochava',
|
|
29
|
+
value: data.raw
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static singular(data) {
|
|
33
|
+
return {
|
|
34
|
+
source: 'Singular',
|
|
35
|
+
value: Object.fromEntries(data)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
static tenjin(data) {
|
|
39
|
+
return {
|
|
40
|
+
source: 'Tenjin',
|
|
41
|
+
value: data
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.ExternalAttributions = ExternalAttributions;
|
|
46
|
+
//# sourceMappingURL=externalAttribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ExternalAttributions","adjust","data","source","value","airbridge","appsflyer","kochava","raw","singular","Object","fromEntries","tenjin","exports"],"sourceRoot":"../../src","sources":["externalAttribution.ts"],"mappings":";;;;;;AAaO,MAAMA,oBAAoB,CAAC;EAChC,OAAOC,MAAMA,CAACC,IAAyB,EAAuB;IAC5D,OAAO;MACLC,MAAM,EAAE,QAAQ;MAChBC,KAAK,EAAEF;IACT,CAAC;EACH;EAEA,OAAOG,SAASA,CAACH,IAAyB,EAAuB;IAC/D,OAAO;MACLC,MAAM,EAAE,WAAW;MACnBC,KAAK,EAAEF;IACT,CAAC;EACH;EAEA,OAAOI,SAASA,CAACJ,IAAyB,EAAuB;IAC/D,OAAO;MACLC,MAAM,EAAE,WAAW;MACnBC,KAAK,EAAEF,IAAI,CAACA;IACd,CAAC;EACH;EAEA,OAAOK,OAAOA,CAACL,IAAyB,EAAuB;IAC7D,OAAO;MACLC,MAAM,EAAE,SAAS;MACjBC,KAAK,EAAEF,IAAI,CAACM;IACd,CAAC;EACH;EAEA,OAAOC,QAAQA,CAACP,IAAyB,EAAuB;IAC9D,OAAO;MACLC,MAAM,EAAE,UAAU;MAClBC,KAAK,EAAEM,MAAM,CAACC,WAAW,CAACT,IAAI;IAChC,CAAC;EACH;EAEA,OAAOU,MAAMA,CAACV,IAAyB,EAAuB;IAC5D,OAAO;MACLC,MAAM,EAAE,QAAQ;MAChBC,KAAK,EAAEF;IACT,CAAC;EACH;AACF;AAACW,OAAA,CAAAb,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
package/lib/commonjs/index.js
CHANGED
|
@@ -47,6 +47,18 @@ Object.keys(_userProfile).forEach(function (key) {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
+
var _externalAttribution = require("./externalAttribution");
|
|
51
|
+
Object.keys(_externalAttribution).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
54
|
+
if (key in exports && exports[key] === _externalAttribution[key]) return;
|
|
55
|
+
Object.defineProperty(exports, key, {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () {
|
|
58
|
+
return _externalAttribution[key];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
});
|
|
50
62
|
const LINKING_ERROR = `The package '@appmetrica/react-native-analytics' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
51
63
|
ios: "- You have run 'pod install'\n",
|
|
52
64
|
default: ''
|
|
@@ -139,6 +151,9 @@ class AppMetrica {
|
|
|
139
151
|
static putErrorEnvironmentValue(key, value) {
|
|
140
152
|
AppMetricaNative.putErrorEnvironmentValue(key, value);
|
|
141
153
|
}
|
|
154
|
+
static reportExternalAttribution(attribution) {
|
|
155
|
+
AppMetricaNative.reportExternalAttribution(attribution);
|
|
156
|
+
}
|
|
142
157
|
}
|
|
143
158
|
exports.default = AppMetrica;
|
|
144
159
|
//# 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","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"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;
|
|
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,GAAAD,OAAA;AAwFA,IAAAE,UAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,UAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,UAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,UAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAf,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAW,QAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,QAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;A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C8C,aAAa,CAACC,OAAO,CAAC;EACzC;EAEA,OAAOC,eAAeA,CAACC,SAAoB,EAAE;IAC3CjD,gBAAgB,CAACgD,eAAe,CAAC,IAAAE,yBAAkB,EAACD,SAAS,CAAC,CAAC;EACjE;EAEA,OAAOE,iBAAiBA,CAACC,WAAwB,EAAE;IACjDpD,gBAAgB,CAACmD,iBAAiB,CAACC,WAAW,CAAC;EACjD;EAEA,OAAOC,wBAAwBA,CAACtE,GAAW,EAAEuE,KAAc,EAAE;IAC3DtD,gBAAgB,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":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export class ExternalAttributions {
|
|
2
|
+
static adjust(data) {
|
|
3
|
+
return {
|
|
4
|
+
source: 'Adjust',
|
|
5
|
+
value: data
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
static airbridge(data) {
|
|
9
|
+
return {
|
|
10
|
+
source: 'Airbridge',
|
|
11
|
+
value: data
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
static appsflyer(data) {
|
|
15
|
+
return {
|
|
16
|
+
source: 'AppsFlyer',
|
|
17
|
+
value: data.data
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
static kochava(data) {
|
|
21
|
+
return {
|
|
22
|
+
source: 'Kochava',
|
|
23
|
+
value: data.raw
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
static singular(data) {
|
|
27
|
+
return {
|
|
28
|
+
source: 'Singular',
|
|
29
|
+
value: Object.fromEntries(data)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static tenjin(data) {
|
|
33
|
+
return {
|
|
34
|
+
source: 'Tenjin',
|
|
35
|
+
value: data
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=externalAttribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ExternalAttributions","adjust","data","source","value","airbridge","appsflyer","kochava","raw","singular","Object","fromEntries","tenjin"],"sourceRoot":"../../src","sources":["externalAttribution.ts"],"mappings":"AAaA,OAAO,MAAMA,oBAAoB,CAAC;EAChC,OAAOC,MAAMA,CAACC,IAAyB,EAAuB;IAC5D,OAAO;MACLC,MAAM,EAAE,QAAQ;MAChBC,KAAK,EAAEF;IACT,CAAC;EACH;EAEA,OAAOG,SAASA,CAACH,IAAyB,EAAuB;IAC/D,OAAO;MACLC,MAAM,EAAE,WAAW;MACnBC,KAAK,EAAEF;IACT,CAAC;EACH;EAEA,OAAOI,SAASA,CAACJ,IAAyB,EAAuB;IAC/D,OAAO;MACLC,MAAM,EAAE,WAAW;MACnBC,KAAK,EAAEF,IAAI,CAACA;IACd,CAAC;EACH;EAEA,OAAOK,OAAOA,CAACL,IAAyB,EAAuB;IAC7D,OAAO;MACLC,MAAM,EAAE,SAAS;MACjBC,KAAK,EAAEF,IAAI,CAACM;IACd,CAAC;EACH;EAEA,OAAOC,QAAQA,CAACP,IAAyB,EAAuB;IAC9D,OAAO;MACLC,MAAM,EAAE,UAAU;MAClBC,KAAK,EAAEM,MAAM,CAACC,WAAW,CAACT,IAAI;IAChC,CAAC;EACH;EAEA,OAAOU,MAAMA,CAACV,IAAyB,EAAuB;IAC5D,OAAO;MACLC,MAAM,EAAE,QAAQ;MAChBC,KAAK,EAAEF;IACT,CAAC;EACH;AACF","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export const UUID_KEY = 'appmetrica_uuid';
|
|
|
29
29
|
export * from './ecommerce';
|
|
30
30
|
export * from './revenue';
|
|
31
31
|
export * from './userProfile';
|
|
32
|
+
export * from './externalAttribution';
|
|
32
33
|
export default class AppMetrica {
|
|
33
34
|
static activate(config) {
|
|
34
35
|
if (!activated) {
|
|
@@ -95,5 +96,8 @@ export default class AppMetrica {
|
|
|
95
96
|
static putErrorEnvironmentValue(key, value) {
|
|
96
97
|
AppMetricaNative.putErrorEnvironmentValue(key, value);
|
|
97
98
|
}
|
|
99
|
+
static reportExternalAttribution(attribution) {
|
|
100
|
+
AppMetricaNative.reportExternalAttribution(attribution);
|
|
101
|
+
}
|
|
98
102
|
}
|
|
99
103
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Linking","NativeModules","Platform","normalizeAdRevenue","LINKING_ERROR","select","ios","default","AppMetricaNative","AppMetrica","Proxy","get","Error","activated","appOpenTracking","getUrlAsync","initialUrl","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","reportUserProfile","userProfile","putErrorEnvironmentValue","key","value"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,OAAO,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["Linking","NativeModules","Platform","normalizeAdRevenue","LINKING_ERROR","select","ios","default","AppMetricaNative","AppMetrica","Proxy","get","Error","activated","appOpenTracking","getUrlAsync","initialUrl","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","reportUserProfile","userProfile","putErrorEnvironmentValue","key","value","reportExternalAttribution","attribution"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,OAAO,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAK/D,SAASC,kBAAkB,QAAQ,SAAS;AAE5C,MAAMC,aAAa,GACjB,6FAA6F,GAC7FF,QAAQ,CAACG,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,gBAAgB,GAAGP,aAAa,CAACQ,UAAU,GAC7CR,aAAa,CAACQ,UAAU,GACxB,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,IAAIS,SAAS,GAAG,KAAK;AAErB,SAASC,eAAeA,CAAA,EAAG;EACzB,MAAMC,WAAW,GAAG,MAAAA,CAAA,KAAY;IAC9B,MAAMC,UAAU,GAAG,MAAMhB,OAAO,CAACiB,aAAa,CAAC,CAAC;IAChD,IAAID,UAAU,IAAI,IAAI,EAAE;MACtBR,gBAAgB,CAACU,aAAa,CAACF,UAAU,CAAC;IAC5C;EACF,CAAC;EACD,MAAMG,QAAQ,GAAIC,KAAsB,IAAK;IAC3CZ,gBAAgB,CAACU,aAAa,CAACE,KAAK,CAACC,GAAG,CAAC;EAC3C,CAAC;EACDN,WAAW,CAAC,CAAC;EACbf,OAAO,CAACsB,gBAAgB,CAAC,KAAK,EAAEH,QAAQ,CAAC;AAC3C;AAmDA,OAAO,MAAMI,kBAAkB,GAAG,2BAA2B;AAC7D,OAAO,MAA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AppsFlyer' | 'Kochava' | 'Singular' | 'Tenjin';
|
|
2
|
+
export interface ExternalAttribution {
|
|
3
|
+
source: ExternalAttributionSource;
|
|
4
|
+
value: Record<string, object>;
|
|
5
|
+
}
|
|
6
|
+
export declare class ExternalAttributions {
|
|
7
|
+
static adjust(data: Record<string, any>): ExternalAttribution;
|
|
8
|
+
static airbridge(data: Record<string, any>): ExternalAttribution;
|
|
9
|
+
static appsflyer(data: Record<string, any>): ExternalAttribution;
|
|
10
|
+
static kochava(data: Record<string, any>): ExternalAttribution;
|
|
11
|
+
static singular(data: Map<string, object>): ExternalAttribution;
|
|
12
|
+
static tenjin(data: Record<string, any>): ExternalAttribution;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=externalAttribution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"externalAttribution.d.ts","sourceRoot":"","sources":["../../../src/externalAttribution.ts"],"names":[],"mappings":"AAAA,KAAK,yBAAyB,GAC1B,QAAQ,GACR,WAAW,GACX,WAAW,GACX,SAAS,GACT,UAAU,GACV,QAAQ,CAAC;AAEb,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,yBAAyB,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,mBAAmB;IAO7D,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,mBAAmB;IAOhE,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,mBAAmB;IAOhE,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,mBAAmB;IAO9D,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,mBAAmB;IAO/D,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,mBAAmB;CAM9D"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ECommerceEvent } from './ecommerce';
|
|
2
2
|
import type { AdRevenue, Revenue } from './revenue';
|
|
3
3
|
import type { UserProfile } from './userProfile';
|
|
4
|
+
import type { ExternalAttribution } from './externalAttribution';
|
|
4
5
|
export type AppMetricaConfig = {
|
|
5
6
|
apiKey: string;
|
|
6
7
|
appVersion?: string;
|
|
@@ -46,6 +47,7 @@ export declare const UUID_KEY = "appmetrica_uuid";
|
|
|
46
47
|
export * from './ecommerce';
|
|
47
48
|
export * from './revenue';
|
|
48
49
|
export * from './userProfile';
|
|
50
|
+
export * from './externalAttribution';
|
|
49
51
|
export default class AppMetrica {
|
|
50
52
|
static activate(config: AppMetricaConfig): void;
|
|
51
53
|
static getLibraryApiLevel(): Promise<number>;
|
|
@@ -66,5 +68,6 @@ export default class AppMetrica {
|
|
|
66
68
|
static reportAdRevenue(adRevenue: AdRevenue): void;
|
|
67
69
|
static reportUserProfile(userProfile: UserProfile): void;
|
|
68
70
|
static putErrorEnvironmentValue(key: string, value?: string): void;
|
|
71
|
+
static reportExternalAttribution(attribution: ExternalAttribution): void;
|
|
69
72
|
}
|
|
70
73
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
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AAE,GAAG,CAAC;IAItE,MAAM,CAAC,oBAAoB,CACzB,QAAQ,EAAE,qBAAqB,EAC/B,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;IAK5B,MAAM,CAAC,aAAa;IAIpB,MAAM,CAAC,gBAAgB;IAIvB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ;IAItC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO;IAI3C,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,OAAO;IAI7C,MAAM,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,MAAM;IAI9C,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,cAAc;IAI5C,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO;IAIrC,MAAM,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS;IAI3C,MAAM,CAAC,iBAAiB,CAAC,WAAW,EAAE,WAAW;IAIjD,MAAM,CAAC,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM;IAI3D,MAAM,CAAC,yBAAyB,CAAC,WAAW,EAAE,mBAAmB;CAGlE"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
type ExternalAttributionSource =
|
|
2
|
+
| 'Adjust'
|
|
3
|
+
| 'Airbridge'
|
|
4
|
+
| 'AppsFlyer'
|
|
5
|
+
| 'Kochava'
|
|
6
|
+
| 'Singular'
|
|
7
|
+
| 'Tenjin';
|
|
8
|
+
|
|
9
|
+
export interface ExternalAttribution {
|
|
10
|
+
source: ExternalAttributionSource;
|
|
11
|
+
value: Record<string, object>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class ExternalAttributions {
|
|
15
|
+
static adjust(data: Record<string, any>): ExternalAttribution {
|
|
16
|
+
return {
|
|
17
|
+
source: 'Adjust',
|
|
18
|
+
value: data,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static airbridge(data: Record<string, any>): ExternalAttribution {
|
|
23
|
+
return {
|
|
24
|
+
source: 'Airbridge',
|
|
25
|
+
value: data,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static appsflyer(data: Record<string, any>): ExternalAttribution {
|
|
30
|
+
return {
|
|
31
|
+
source: 'AppsFlyer',
|
|
32
|
+
value: data.data,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static kochava(data: Record<string, any>): ExternalAttribution {
|
|
37
|
+
return {
|
|
38
|
+
source: 'Kochava',
|
|
39
|
+
value: data.raw,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static singular(data: Map<string, object>): ExternalAttribution {
|
|
44
|
+
return {
|
|
45
|
+
source: 'Singular',
|
|
46
|
+
value: Object.fromEntries(data),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static tenjin(data: Record<string, any>): ExternalAttribution {
|
|
51
|
+
return {
|
|
52
|
+
source: 'Tenjin',
|
|
53
|
+
value: data,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Linking, NativeModules, Platform } from 'react-native';
|
|
|
2
2
|
import type { ECommerceEvent } from './ecommerce';
|
|
3
3
|
import type { AdRevenue, Revenue } from './revenue';
|
|
4
4
|
import type { UserProfile } from './userProfile';
|
|
5
|
+
import type { ExternalAttribution } from './externalAttribution';
|
|
5
6
|
import { normalizeAdRevenue } from './utils';
|
|
6
7
|
|
|
7
8
|
const LINKING_ERROR =
|
|
@@ -55,7 +56,7 @@ export type AppMetricaConfig = {
|
|
|
55
56
|
appOpenTrackingEnabled?: boolean;
|
|
56
57
|
userProfileID?: string;
|
|
57
58
|
|
|
58
|
-
errorEnvironment?: Record<string, string | undefined
|
|
59
|
+
errorEnvironment?: Record<string, string | undefined>;
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
export type PreloadInfo = {
|
|
@@ -93,6 +94,7 @@ export const UUID_KEY = 'appmetrica_uuid';
|
|
|
93
94
|
export * from './ecommerce';
|
|
94
95
|
export * from './revenue';
|
|
95
96
|
export * from './userProfile';
|
|
97
|
+
export * from './externalAttribution';
|
|
96
98
|
|
|
97
99
|
export default class AppMetrica {
|
|
98
100
|
static activate(config: AppMetricaConfig) {
|
|
@@ -174,10 +176,14 @@ export default class AppMetrica {
|
|
|
174
176
|
}
|
|
175
177
|
|
|
176
178
|
static reportUserProfile(userProfile: UserProfile) {
|
|
177
|
-
AppMetricaNative.reportUserProfile(userProfile)
|
|
179
|
+
AppMetricaNative.reportUserProfile(userProfile);
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
static putErrorEnvironmentValue(key: string, value?: string) {
|
|
181
183
|
AppMetricaNative.putErrorEnvironmentValue(key, value);
|
|
182
184
|
}
|
|
185
|
+
|
|
186
|
+
static reportExternalAttribution(attribution: ExternalAttribution) {
|
|
187
|
+
AppMetricaNative.reportExternalAttribution(attribution);
|
|
188
|
+
}
|
|
183
189
|
}
|