mapp-intelligence-reactnative-plugin 1.0.3 → 1.1.1
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/build.gradle +46 -63
- package/android/gradle.properties +7 -6
- package/android/settings.gradle +24 -0
- package/android/specs/MappinteligencePluginSpec.js +8 -0
- package/android/src/main/AndroidManifest.xml +3 -2
- package/android/src/main/java/com/mappinteligenceplugin/MappinteligencePluginModule.kt +296 -262
- package/android/src/main/java/com/mappinteligenceplugin/MappinteligencePluginPackage.kt +18 -7
- package/android/src/main/java/com/mappinteligenceplugin/MappintelligencePluginSpec.kt +59 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/Info.plist +48 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIActionEvent.h +33 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MICampaignParameters.h +32 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIDefaultTracker.h +49 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIEcommerceParameters.h +52 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIEventParameters.h +23 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIFormField.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIFormParameters.h +48 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIFormSubmitEvent.h +22 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIMediaEvent.h +30 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIMediaParameters.h +31 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIPageParameters.h +27 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIPageViewEvent.h +34 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIParamType.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIParams.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIProduct.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIProperties.h +49 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MISessionParameters.h +20 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MITrackerRequest.h +39 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MITrackingEvent.h +23 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIUsageStatistics.h +32 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MIUserCategories.h +49 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MappIntelligence.h +260 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceSDK/MappIntelligenceSDK.h +9 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIActionEvent.h +33 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MICampaignParameters.h +32 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIDefaultTracker.h +49 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIEcommerceParameters.h +52 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIEventParameters.h +23 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIFormField.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIFormParameters.h +48 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIFormSubmitEvent.h +22 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIMediaEvent.h +30 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIMediaParameters.h +31 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIPageParameters.h +27 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIPageViewEvent.h +34 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIParamType.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIParams.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIProduct.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MISessionParameters.h +20 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MITrackingEvent.h +23 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIUsageStatistics.h +32 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIUserCategories.h +49 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MIWebViewTracker.h +21 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MappIntelligence.h +260 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MappIntelligenceLogger.h +47 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/Headers/MappIntelligenceiOS/MappIntelligenceiOS.h +13 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64/libMappIntelligenceiOS.a +0 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIActionEvent.h +33 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MICampaignParameters.h +32 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIDefaultTracker.h +49 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIEcommerceParameters.h +52 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIEventParameters.h +23 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIFormField.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIFormParameters.h +48 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIFormSubmitEvent.h +22 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIMediaEvent.h +30 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIMediaParameters.h +31 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIPageParameters.h +27 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIPageViewEvent.h +34 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIParamType.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIParams.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIProduct.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIProperties.h +49 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MISessionParameters.h +20 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MITrackerRequest.h +39 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MITrackingEvent.h +23 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIUsageStatistics.h +32 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MIUserCategories.h +49 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MappIntelligence.h +260 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceSDK/MappIntelligenceSDK.h +9 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIActionEvent.h +33 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MICampaignParameters.h +32 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIDefaultTracker.h +49 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIEcommerceParameters.h +52 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIEventParameters.h +23 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIFormField.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIFormParameters.h +48 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIFormSubmitEvent.h +22 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIMediaEvent.h +30 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIMediaParameters.h +31 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIPageParameters.h +27 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIPageViewEvent.h +34 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIParamType.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIParams.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIProduct.h +28 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MISessionParameters.h +20 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MITrackingEvent.h +23 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIUsageStatistics.h +32 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIUserCategories.h +49 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MIWebViewTracker.h +21 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MappIntelligence.h +260 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MappIntelligenceLogger.h +47 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/Headers/MappIntelligenceiOS/MappIntelligenceiOS.h +13 -0
- package/ios/Frameworks/MappIntelligenceiOS.xcframework/ios-arm64_x86_64-simulator/libMappIntelligenceiOS.a +0 -0
- package/ios/MappinteligencePlugin.mm +50 -24
- package/lib/module/Converters.js +2 -0
- package/lib/module/Converters.js.map +1 -1
- package/lib/module/DataTypes.js +2 -0
- package/lib/module/DataTypes.js.map +1 -1
- package/lib/module/GlobalErrorHandler.js +9 -12
- package/lib/module/GlobalErrorHandler.js.map +1 -1
- package/lib/module/MappIntelligencePlugin.js +19 -4
- package/lib/module/MappIntelligencePlugin.js.map +1 -1
- package/lib/module/NativeMappintelligencePlugin.js +5 -0
- package/lib/module/NativeMappintelligencePlugin.js.map +1 -0
- package/lib/module/UseWebTracking.js +23 -21
- package/lib/module/UseWebTracking.js.map +1 -1
- package/lib/module/global.d.js +2 -0
- package/lib/module/global.d.js.map +1 -1
- package/lib/module/index.js +8 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/promiseRejectionHandler.js +4 -9
- package/lib/module/promiseRejectionHandler.js.map +1 -1
- package/lib/typescript/src/DataTypes.d.ts +6 -6
- package/lib/typescript/src/DataTypes.d.ts.map +1 -1
- package/lib/typescript/src/GlobalErrorHandler.d.ts +1 -1
- package/lib/typescript/src/GlobalErrorHandler.d.ts.map +1 -1
- package/lib/typescript/src/MappIntelligencePlugin.d.ts +6 -0
- package/lib/typescript/src/MappIntelligencePlugin.d.ts.map +1 -1
- package/lib/typescript/src/NativeMappintelligencePlugin.d.ts +39 -0
- package/lib/typescript/src/NativeMappintelligencePlugin.d.ts.map +1 -0
- package/lib/typescript/src/UseWebTracking.d.ts +1 -2
- package/lib/typescript/src/UseWebTracking.d.ts.map +1 -1
- package/lib/typescript/src/promiseRejectionHandler.d.ts.map +1 -1
- package/mapp-intelligence-reactnative-plugin.podspec +4 -1
- package/package.json +39 -40
- package/src/GlobalErrorHandler.tsx +8 -13
- package/src/MappIntelligencePlugin.tsx +27 -12
- package/src/NativeMappintelligencePlugin.ts +55 -0
- package/src/UseWebTracking.tsx +29 -27
- package/src/promiseRejectionHandler.tsx +5 -10
- package/lib/commonjs/Converters.js +0 -168
- package/lib/commonjs/Converters.js.map +0 -1
- package/lib/commonjs/DataTypes.js +0 -79
- package/lib/commonjs/DataTypes.js.map +0 -1
- package/lib/commonjs/GlobalErrorHandler.js +0 -47
- package/lib/commonjs/GlobalErrorHandler.js.map +0 -1
- package/lib/commonjs/MappIntelligencePlugin.js +0 -296
- package/lib/commonjs/MappIntelligencePlugin.js.map +0 -1
- package/lib/commonjs/UseWebTracking.js +0 -96
- package/lib/commonjs/UseWebTracking.js.map +0 -1
- package/lib/commonjs/global.d.js +0 -6
- package/lib/commonjs/global.d.js.map +0 -1
- package/lib/commonjs/index.js +0 -72
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/promiseRejectionHandler.js +0 -50
- package/lib/commonjs/promiseRejectionHandler.js.map +0 -1
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MappIntelligencePlugin = void 0;
|
|
7
|
-
var _reactNative = require("react-native");
|
|
8
|
-
var _Converters = require("./Converters");
|
|
9
|
-
const LINKING_ERROR = `The package 'mapp-intelligence-reactnative-plugin' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
10
|
-
ios: "- You have run 'pod install'\n",
|
|
11
|
-
default: ''
|
|
12
|
-
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
|
|
13
|
-
const mappPlugin = _reactNative.NativeModules.MappinteligencePlugin ? _reactNative.NativeModules.MappinteligencePlugin : new Proxy({}, {
|
|
14
|
-
get() {
|
|
15
|
-
throw new Error(LINKING_ERROR);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
const MappIntelligencePlugin = exports.MappIntelligencePlugin = {
|
|
19
|
-
/**
|
|
20
|
-
* Builds plugin with a provided configuration. After this method finishes, plugin is ready for use.
|
|
21
|
-
* @returns result if method executed succesfully or not
|
|
22
|
-
*/
|
|
23
|
-
build: () => {
|
|
24
|
-
console.log('build');
|
|
25
|
-
return mappPlugin.build();
|
|
26
|
-
},
|
|
27
|
-
/**
|
|
28
|
-
* Initialize plugin with a provided trackIds and domain
|
|
29
|
-
* @param trackIDs array of trackIds
|
|
30
|
-
* @param domain tracking domain url
|
|
31
|
-
* @returns result if method executed succesfully or not
|
|
32
|
-
*/
|
|
33
|
-
initWithConfiguration: (trackIDs, domain) => {
|
|
34
|
-
console.log('initWithConfiguration');
|
|
35
|
-
return mappPlugin.initWithConfiguration(trackIDs, domain);
|
|
36
|
-
},
|
|
37
|
-
/**
|
|
38
|
-
* Set log level to define what will be logged to the console
|
|
39
|
-
* @param level log level
|
|
40
|
-
* @returns result if method executed succesfully or not
|
|
41
|
-
*/
|
|
42
|
-
setLogLevel: level => {
|
|
43
|
-
console.log('setLogLevel - ' + level.valueOf());
|
|
44
|
-
return mappPlugin.setLogLevel(level.valueOf());
|
|
45
|
-
},
|
|
46
|
-
/**
|
|
47
|
-
* Set exception log level
|
|
48
|
-
* @param level one of the predefined exception types
|
|
49
|
-
* @returns result if method executed succesfully or not
|
|
50
|
-
*/
|
|
51
|
-
setExceptionLogLevel: level => {
|
|
52
|
-
return mappPlugin.setExceptionLogLevel(level);
|
|
53
|
-
},
|
|
54
|
-
/**
|
|
55
|
-
* Sets interval in minutes, for periodic job to execute and send tracked requests to a server
|
|
56
|
-
* @param interval number in minutes. The minimum is 15, limited by Android specification for a worker.
|
|
57
|
-
* @returns result if method executed succesfully or not
|
|
58
|
-
*/
|
|
59
|
-
setRequestInterval: interval => {
|
|
60
|
-
console.log('setRequestInterval');
|
|
61
|
-
return mappPlugin.setRequestInterval(interval);
|
|
62
|
-
},
|
|
63
|
-
/**
|
|
64
|
-
* If sets to true, request will be send in a batch (multiple records in single network call);
|
|
65
|
-
* Otherwise records are sent one record by one network call.
|
|
66
|
-
* @param enabled speciffy if batch is enabled or disabled
|
|
67
|
-
* @returns result if method executed succesfully or not
|
|
68
|
-
*/
|
|
69
|
-
setBatchSupportEnabled: enabled => {
|
|
70
|
-
console.log('setBatchSupportEnabled');
|
|
71
|
-
return mappPlugin.setBatchSupportEnabled(enabled);
|
|
72
|
-
},
|
|
73
|
-
/**
|
|
74
|
-
* iOS Only - Enable sending data while application is in a background state
|
|
75
|
-
* @param enabled
|
|
76
|
-
* @returns result if method executed succesfully or not
|
|
77
|
-
*/
|
|
78
|
-
setEnableBackgroundSendout: enabled => {
|
|
79
|
-
console.log('setEnableBackgroundSendout');
|
|
80
|
-
return mappPlugin.setEnableBackgroundSendout(enabled);
|
|
81
|
-
},
|
|
82
|
-
/**
|
|
83
|
-
* Set number of track records to send in a sigle batch request
|
|
84
|
-
* @param size number of track records
|
|
85
|
-
* @returns result if method executed succesfully or not
|
|
86
|
-
*/
|
|
87
|
-
setBatchSupportSize: size => {
|
|
88
|
-
console.log('setBatchSupportSize');
|
|
89
|
-
return mappPlugin.setBatchSupportSize(size);
|
|
90
|
-
},
|
|
91
|
-
/**
|
|
92
|
-
* Requests are buffered in a queue before sending. This option set size of the queue.
|
|
93
|
-
* @param numberOfRequsts size of a queue for buffering requests
|
|
94
|
-
* @returns result if method executed succesfully or not
|
|
95
|
-
*/
|
|
96
|
-
setRequestPerQueue: numberOfRequsts => {
|
|
97
|
-
console.log('setRequestPerQueue');
|
|
98
|
-
return mappPlugin.setRequestPerQueue(numberOfRequsts);
|
|
99
|
-
},
|
|
100
|
-
/**
|
|
101
|
-
* Control if migration should be applied from a previos SDK version.
|
|
102
|
-
* @param migrate true to apply migration on the initialization process; otherwise false
|
|
103
|
-
* @returns result if method executed succesfully or not
|
|
104
|
-
*/
|
|
105
|
-
setShouldMigrate: migrate => {
|
|
106
|
-
console.log('setShouldMigrate');
|
|
107
|
-
return mappPlugin.setShouldMigrate(migrate);
|
|
108
|
-
},
|
|
109
|
-
/**
|
|
110
|
-
* Based on the result of the user's conset to allow personalized tracking or not,
|
|
111
|
-
* enable anonymous tracking when no consent. If enabled, everId will be deleted (and not generated until anonymous tracking is enabled)
|
|
112
|
-
* @param anonymous true to enable anonymous tracking; false to disable it.
|
|
113
|
-
* @returns result if method executed succesfully or not
|
|
114
|
-
*/
|
|
115
|
-
setAnonymousTracking: anonymous => {
|
|
116
|
-
console.log('setAnonymousTracking');
|
|
117
|
-
return mappPlugin.setAnonymousTracking(anonymous);
|
|
118
|
-
},
|
|
119
|
-
/**
|
|
120
|
-
* Send application version as parameter in every request
|
|
121
|
-
* @param flag - true to set sending application version in every request; otherwise false.
|
|
122
|
-
* @returns result if method executed succesfully or not
|
|
123
|
-
*/
|
|
124
|
-
setSendAppVersionInEveryRequest: flag => {
|
|
125
|
-
console.log('setSendAppVersionInEveryRequest');
|
|
126
|
-
return mappPlugin.setSendAppVersionInEveryRequest(flag);
|
|
127
|
-
},
|
|
128
|
-
/**
|
|
129
|
-
* To enable user matching between Engage and Intelligence system
|
|
130
|
-
* @param enabled true to enable user matching; false to disable it.
|
|
131
|
-
* @returns result if method executed succesfully or not
|
|
132
|
-
*/
|
|
133
|
-
setEnableUserMatching: enabled => {
|
|
134
|
-
console.log('setEnableUserMatching');
|
|
135
|
-
return mappPlugin.setEnableUserMatching(enabled);
|
|
136
|
-
},
|
|
137
|
-
/**
|
|
138
|
-
* Track single page by page name
|
|
139
|
-
* @param pageTitle page name for tracking
|
|
140
|
-
* @returns result if method executed succesfully or not
|
|
141
|
-
*/
|
|
142
|
-
trackPage: pageTitle => {
|
|
143
|
-
console.log('trackPage');
|
|
144
|
-
return mappPlugin.trackPage(pageTitle);
|
|
145
|
-
},
|
|
146
|
-
/**
|
|
147
|
-
* Detailed page tracking with additional parameters that can be set to track
|
|
148
|
-
* @param pageTitle - name of the page
|
|
149
|
-
* @param pageParameters - parameters for the page
|
|
150
|
-
* @param sessionParamters - parameters for the current session
|
|
151
|
-
* @param userCategories - predefined user categories
|
|
152
|
-
* @param ecommerceParameters - predefined eCommerce parameters
|
|
153
|
-
* @param campaignParameters - predefined campaign parameters
|
|
154
|
-
* @returns result if method executed succesfully or not
|
|
155
|
-
*/
|
|
156
|
-
trackCustomPage: (pageTitle, pageParameters, sessionParamters, userCategories, ecommerceParameters, campaignParameters) => {
|
|
157
|
-
console.log('trackCustomPage');
|
|
158
|
-
return mappPlugin.trackCustomPage(pageTitle, (0, _Converters.convertPageParameters)(pageParameters), (0, _Converters.convertSessionParamters)(sessionParamters), (0, _Converters.convertUserCategories)(userCategories), (0, _Converters.convertEcommerceParameters)(ecommerceParameters), (0, _Converters.convertCampaignParameters)(campaignParameters));
|
|
159
|
-
},
|
|
160
|
-
/**
|
|
161
|
-
* Custom page tracking with option to track some custom parameters
|
|
162
|
-
* @param pageTitle - name of the page
|
|
163
|
-
* @param pageParameters - custom parameters that can be tracked
|
|
164
|
-
* @returns result if method executed succesfully or not
|
|
165
|
-
*/
|
|
166
|
-
trackPageWithCustomData: (pageTitle, pageParameters) => {
|
|
167
|
-
console.log('trackPageWithCustomData', pageParameters);
|
|
168
|
-
return mappPlugin.trackPageWithCustomData(pageParameters, pageTitle);
|
|
169
|
-
},
|
|
170
|
-
/**
|
|
171
|
-
* Track user action
|
|
172
|
-
* @param name - action name
|
|
173
|
-
* @param eventParameters - predefined event parameters
|
|
174
|
-
* @param sessionParamters - predefined session parameters
|
|
175
|
-
* @param userCategories - predefined user categories
|
|
176
|
-
* @param ecommerceParameters - predefined ecommerce parameters
|
|
177
|
-
* @param campaignParameters - predefined campaign parameters
|
|
178
|
-
* @returns result if method executed succesfully or not
|
|
179
|
-
*/
|
|
180
|
-
trackAction: (name, eventParameters, sessionParamters, userCategories, ecommerceParameters, campaignParameters) => {
|
|
181
|
-
console.log('trackAction');
|
|
182
|
-
return mappPlugin.trackAction(name, (0, _Converters.convertEventParameters)(eventParameters), (0, _Converters.convertSessionParamters)(sessionParamters), (0, _Converters.convertUserCategories)(userCategories), (0, _Converters.convertEcommerceParameters)(ecommerceParameters), (0, _Converters.convertCampaignParameters)(campaignParameters));
|
|
183
|
-
},
|
|
184
|
-
/**
|
|
185
|
-
* Track URL's with included deeplinks, media parameters
|
|
186
|
-
* @param url single url that can contain some query parameters for tracking
|
|
187
|
-
* @param mediaCode media code to track
|
|
188
|
-
* @returns result if method executed succesfully or not
|
|
189
|
-
*/
|
|
190
|
-
trackUrl: (url, mediaCode) => {
|
|
191
|
-
return mappPlugin.trackUrl(url, mediaCode);
|
|
192
|
-
},
|
|
193
|
-
/**
|
|
194
|
-
* Track video or audio events - starting, playing, pausing/stoping, ending of playing
|
|
195
|
-
* @param mediaEvent predefined events to track
|
|
196
|
-
* @returns result if method executed succesfully or not
|
|
197
|
-
*/
|
|
198
|
-
trackMedia: mediaEvent => {
|
|
199
|
-
console.log('Execute MediaEvent');
|
|
200
|
-
return mappPlugin.trackMedia((0, _Converters.convertMediaEvent)(mediaEvent));
|
|
201
|
-
},
|
|
202
|
-
/**
|
|
203
|
-
* Record data about handled exceptions
|
|
204
|
-
* @param e caught exception
|
|
205
|
-
* @param stackTrace stack trace of the caught exception
|
|
206
|
-
* @returns result if method executed succesfully or not
|
|
207
|
-
*/
|
|
208
|
-
trackException: (e, stackTrace) => {
|
|
209
|
-
return mappPlugin.trackException(e.name, e.message?.slice(0, 1000), stackTrace?.slice(0, 1000));
|
|
210
|
-
},
|
|
211
|
-
/**
|
|
212
|
-
* Record data about handled exception
|
|
213
|
-
* @param name name or type of the exception if can be obtained
|
|
214
|
-
* @param message message of the current caught exception
|
|
215
|
-
* @param stackTrace stack trace of the caught exception
|
|
216
|
-
* @returns result if method executed succesfully or not
|
|
217
|
-
*/
|
|
218
|
-
trackExceptionWithName: (name, message, stackTrace) => {
|
|
219
|
-
return mappPlugin.trackException(name, message.slice(0, 1000), stackTrace?.slice(0, 1000));
|
|
220
|
-
},
|
|
221
|
-
/**
|
|
222
|
-
* Set unique everId as identifier for a single device/user
|
|
223
|
-
* @param everId unique identifier in the tracking system
|
|
224
|
-
* @returns result if method executed succesfully or not
|
|
225
|
-
*/
|
|
226
|
-
setEverId: everId => {
|
|
227
|
-
console.log('setEverId');
|
|
228
|
-
return mappPlugin.setEverId(everId);
|
|
229
|
-
},
|
|
230
|
-
/**
|
|
231
|
-
* Returns current everId of a device
|
|
232
|
-
* @returns everId
|
|
233
|
-
*/
|
|
234
|
-
getEverId: () => {
|
|
235
|
-
return mappPlugin.getEverId();
|
|
236
|
-
},
|
|
237
|
-
/**
|
|
238
|
-
* Check if plugin is initialized and ready to use
|
|
239
|
-
* @returns true if plugin is ready to use; false otherwise.
|
|
240
|
-
*/
|
|
241
|
-
isInitialized: () => {
|
|
242
|
-
return mappPlugin.isInitialized();
|
|
243
|
-
},
|
|
244
|
-
/**
|
|
245
|
-
* Temporary sessionId is used when anonymous tracking is enabled to provide
|
|
246
|
-
* anonymous tracking of a single session
|
|
247
|
-
* @param sessionId unique session identifier
|
|
248
|
-
* @returns result if method executed succesfully or not
|
|
249
|
-
*/
|
|
250
|
-
setTemporarySessionId: sessionId => {
|
|
251
|
-
console.log('setTemporarySessionId');
|
|
252
|
-
return mappPlugin.setTemporarySessionId(sessionId);
|
|
253
|
-
},
|
|
254
|
-
/**
|
|
255
|
-
* In some cases, it is necessary to exclude users completely from tracking.
|
|
256
|
-
* For this purpose, the SDK provides an opt-out option.
|
|
257
|
-
* Internally, calling this method will delete all current tracking data cached in the database (if sendCurrentData is set to false), cancel the sending of requests, terminate the WorkManager, and disable all incoming tracking requests.
|
|
258
|
-
* @param sendData true to send recorded data before opt-out
|
|
259
|
-
* @returns result if method executed succesfully or not
|
|
260
|
-
*/
|
|
261
|
-
optOut: sendData => {
|
|
262
|
-
return mappPlugin.optOut(sendData);
|
|
263
|
-
},
|
|
264
|
-
/**
|
|
265
|
-
* Disables opt-out, and resets tracking to enabled.
|
|
266
|
-
* @param sendData true to send recorded data before opt-in
|
|
267
|
-
* @returns result if method executed succesfully or not
|
|
268
|
-
*/
|
|
269
|
-
optIn: sendData => {
|
|
270
|
-
return mappPlugin.optIn(sendData);
|
|
271
|
-
},
|
|
272
|
-
/**
|
|
273
|
-
* Reset all webtrekk configuration. After this, new init with settings must be called before using plugin.
|
|
274
|
-
* @returns result if method executed succesfully or not
|
|
275
|
-
*/
|
|
276
|
-
reset: () => {
|
|
277
|
-
return mappPlugin.reset();
|
|
278
|
-
},
|
|
279
|
-
/**
|
|
280
|
-
* When called, data will be immediately sent.
|
|
281
|
-
* The request will then be deleted from the database, cleaning it.
|
|
282
|
-
* Please note that the application must be started and visible to use this method.
|
|
283
|
-
* @returns result if method executed succesfully or not
|
|
284
|
-
*/
|
|
285
|
-
sendRequestsAndClean: () => {
|
|
286
|
-
return mappPlugin.sendRequestsAndClean();
|
|
287
|
-
},
|
|
288
|
-
/**
|
|
289
|
-
* Get active configuration of the native SDK and returns it as a string
|
|
290
|
-
* @returns string representation of the active configuration
|
|
291
|
-
*/
|
|
292
|
-
printCurrentConfig: () => {
|
|
293
|
-
return mappPlugin.getCurrentConfig();
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
//# sourceMappingURL=MappIntelligencePlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_Converters","LINKING_ERROR","Platform","select","ios","default","mappPlugin","NativeModules","MappinteligencePlugin","Proxy","get","Error","MappIntelligencePlugin","exports","build","console","log","initWithConfiguration","trackIDs","domain","setLogLevel","level","valueOf","setExceptionLogLevel","setRequestInterval","interval","setBatchSupportEnabled","enabled","setEnableBackgroundSendout","setBatchSupportSize","size","setRequestPerQueue","numberOfRequsts","setShouldMigrate","migrate","setAnonymousTracking","anonymous","setSendAppVersionInEveryRequest","flag","setEnableUserMatching","trackPage","pageTitle","trackCustomPage","pageParameters","sessionParamters","userCategories","ecommerceParameters","campaignParameters","convertPageParameters","convertSessionParamters","convertUserCategories","convertEcommerceParameters","convertCampaignParameters","trackPageWithCustomData","trackAction","name","eventParameters","convertEventParameters","trackUrl","url","mediaCode","trackMedia","mediaEvent","convertMediaEvent","trackException","e","stackTrace","message","slice","trackExceptionWithName","setEverId","everId","getEverId","isInitialized","setTemporarySessionId","sessionId","optOut","sendData","optIn","reset","sendRequestsAndClean","printCurrentConfig","getCurrentConfig"],"sourceRoot":"../../src","sources":["MappIntelligencePlugin.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAqBA,MAAME,aAAa,GACjB,+FAA+F,GAC/FC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,UAAU,GAAGC,0BAAa,CAACC,qBAAqB,GAClDD,0BAAa,CAACC,qBAAqB,GACnC,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEE,MAAMW,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG;EACpC;AACF;AACA;AACA;EACEE,KAAK,EAAEA,CAAA,KAAuB;IAC5BC,OAAO,CAACC,GAAG,CAAC,OAAO,CAAC;IACpB,OAAOV,UAAU,CAACQ,KAAK,CAAC,CAAC;EAC3B,CAAC;EAED;AACF;AACA;AACA;AACA;AACA;EACEG,qBAAqB,EAAEA,CACrBC,QAAkB,EAClBC,MAAc,KACM;IACpBJ,OAAO,CAACC,GAAG,CAAC,uBAAuB,CAAC;IACpC,OAAOV,UAAU,CAACW,qBAAqB,CAACC,QAAQ,EAAEC,MAAM,CAAC;EAC3D,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,WAAW,EAAGC,KAAe,IAAsB;IACjDN,OAAO,CAACC,GAAG,CAAC,gBAAgB,GAAGK,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC;IAC/C,OAAOhB,UAAU,CAACc,WAAW,CAACC,KAAK,CAACC,OAAO,CAAC,CAAC,CAAC;EAChD,CAAC;EAED;AACF;AACA;AACA;AACA;EACEC,oBAAoB,EAAGF,KAAoB,IAAsB;IAC/D,OAAO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E,oBAAoB,CAAC,CAAC;EAC1C,CAAC;EAED;AACF;AACA;AACA;EACEC,kBAAkB,EAAEA,CAAA,KAAuB;IACzC,OAAO3E,UAAU,CAAC4E,gBAAgB,CAAC,CAAC;EACtC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useWebTracking = void 0;
|
|
7
|
-
var _MappIntelligencePlugin = require("./MappIntelligencePlugin");
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
const runOnce = `
|
|
10
|
-
var meta = document.createElement('meta');
|
|
11
|
-
meta.setAttribute('name', 'viewport');
|
|
12
|
-
meta.setAttribute('content', 'width=device-width, height=device-height, initial-scale=0.85, maximum-scale=1.0, user-scalable=no');
|
|
13
|
-
document.getElementsByTagName('head')[0].appendChild(meta);
|
|
14
|
-
`;
|
|
15
|
-
const injectEverIdScript = `window.webtrekkApplicationEverId = '%everId%' ; true; `;
|
|
16
|
-
const useWebTracking = (onMessage, onLoad) => {
|
|
17
|
-
const webViewRef = (0, _react.useRef)(null);
|
|
18
|
-
const handleMessage = (0, _react.useCallback)(event => {
|
|
19
|
-
try {
|
|
20
|
-
const message = JSON.parse(event.nativeEvent.data);
|
|
21
|
-
const method = message.method;
|
|
22
|
-
const name = message.name;
|
|
23
|
-
const params = message.params;
|
|
24
|
-
console.log(method, name, params);
|
|
25
|
-
if (method === 'trackCustomPage') {
|
|
26
|
-
trackCustomPage(name, params);
|
|
27
|
-
} else if (method === 'trackCustomEvent') {
|
|
28
|
-
trackCustomEvent(name, params);
|
|
29
|
-
}
|
|
30
|
-
} catch (error) {
|
|
31
|
-
console.error('Error parsing message from WebView', error);
|
|
32
|
-
}
|
|
33
|
-
onMessage?.(event.nativeEvent.data);
|
|
34
|
-
}, [onMessage]);
|
|
35
|
-
const trackCustomPage = (name, params) => {
|
|
36
|
-
try {
|
|
37
|
-
const parameters = getJson(params);
|
|
38
|
-
console.log('Page Name: ', name, '; Params: ', parameters);
|
|
39
|
-
_MappIntelligencePlugin.MappIntelligencePlugin.trackPageWithCustomData(name, parameters);
|
|
40
|
-
} catch (error) {
|
|
41
|
-
console.error(error);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const trackCustomEvent = (name, params) => {
|
|
45
|
-
try {
|
|
46
|
-
const parameters = getJson(params);
|
|
47
|
-
console.log('Event Name: ', name, '; Params: ', parameters);
|
|
48
|
-
_MappIntelligencePlugin.MappIntelligencePlugin.trackAction(name, parameters, null, null, null, null);
|
|
49
|
-
} catch (error) {
|
|
50
|
-
console.error(error);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const getJson = data => {
|
|
54
|
-
try {
|
|
55
|
-
if (data) {
|
|
56
|
-
const json = JSON.parse(data);
|
|
57
|
-
return json;
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
} catch (error) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const handleLoad = (0, _react.useCallback)(() => {
|
|
65
|
-
_MappIntelligencePlugin.MappIntelligencePlugin.getEverId().then(everId => {
|
|
66
|
-
if (webViewRef.current) {
|
|
67
|
-
const scripts = injectEverIdScript.replace('%everId%', everId);
|
|
68
|
-
webViewRef.current.injectJavaScript(scripts);
|
|
69
|
-
console.log('Injected scripts: ', scripts);
|
|
70
|
-
setTimeout(() => {
|
|
71
|
-
webViewRef.current?.injectJavaScript(`window.WebtrekkAndroidWebViewCallback.getEverId()`);
|
|
72
|
-
}, 1000);
|
|
73
|
-
}
|
|
74
|
-
}).catch(error => {
|
|
75
|
-
console.error(error);
|
|
76
|
-
_MappIntelligencePlugin.MappIntelligencePlugin.trackException(error);
|
|
77
|
-
});
|
|
78
|
-
if (onLoad) {
|
|
79
|
-
onLoad();
|
|
80
|
-
}
|
|
81
|
-
}, []);
|
|
82
|
-
const getInjectedJavaScript = script => {
|
|
83
|
-
if (script) {
|
|
84
|
-
return runOnce + '; true; ' + script;
|
|
85
|
-
}
|
|
86
|
-
return runOnce;
|
|
87
|
-
};
|
|
88
|
-
return {
|
|
89
|
-
webViewRef,
|
|
90
|
-
handleMessage,
|
|
91
|
-
handleLoad,
|
|
92
|
-
getInjectedJavaScript
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
exports.useWebTracking = useWebTracking;
|
|
96
|
-
//# sourceMappingURL=UseWebTracking.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_MappIntelligencePlugin","require","_react","runOnce","injectEverIdScript","useWebTracking","onMessage","onLoad","webViewRef","useRef","handleMessage","useCallback","event","message","JSON","parse","nativeEvent","data","method","name","params","console","log","trackCustomPage","trackCustomEvent","error","parameters","getJson","MappIntelligencePlugin","trackPageWithCustomData","trackAction","json","handleLoad","getEverId","then","everId","current","scripts","replace","injectJavaScript","setTimeout","catch","trackException","getInjectedJavaScript","script","exports"],"sourceRoot":"../../src","sources":["UseWebTracking.tsx"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAIA,MAAME,OAAO,GAAG;AAChB;AACA;AACA;AACA;AACA,KAAK;AACL,MAAMC,kBAAkB,GAAG,wDAAwD;AAM5E,MAAMC,cAAc,GAAGA,CAC5BC,SAA4B,EAC5BC,MAAsB,KACnB;EACH,MAAMC,UAAU,GAAG,IAAAC,aAAM,EAAU,IAAI,CAAC;EAExC,MAAMC,aAAa,GAAG,IAAAC,kBAAW,EAC9BC,KAA0B,IAAK;IAC9B,IAAI;MACF,MAAMC,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACH,KAAK,CAACI,WAAW,CAACC,IAAI,CAAC;MAClD,MAAMC,MAAM,GAAGL,OAAO,CAACK,MAAM;MAC7B,MAAMC,IAAI,GAAGN,OAAO,CAACM,IAAI;MACzB,MAAMC,MAAM,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AACzE,CAAC;AAACE,OAAA,CAAAxC,cAAA,GAAAA,cAAA","ignoreList":[]}
|
package/lib/commonjs/global.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["global.d.ts"],"mappings":"","ignoreList":[]}
|
package/lib/commonjs/index.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
MappIntelligencePlugin: true,
|
|
8
|
-
useWebTracking: true
|
|
9
|
-
};
|
|
10
|
-
Object.defineProperty(exports, "MappIntelligencePlugin", {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _MappIntelligencePlugin.MappIntelligencePlugin;
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
Object.defineProperty(exports, "useWebTracking", {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return _UseWebTracking.useWebTracking;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
var _MappIntelligencePlugin = require("./MappIntelligencePlugin");
|
|
23
|
-
var _Converters = require("./Converters");
|
|
24
|
-
Object.keys(_Converters).forEach(function (key) {
|
|
25
|
-
if (key === "default" || key === "__esModule") return;
|
|
26
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
27
|
-
if (key in exports && exports[key] === _Converters[key]) return;
|
|
28
|
-
Object.defineProperty(exports, key, {
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () {
|
|
31
|
-
return _Converters[key];
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
var _DataTypes = require("./DataTypes");
|
|
36
|
-
Object.keys(_DataTypes).forEach(function (key) {
|
|
37
|
-
if (key === "default" || key === "__esModule") return;
|
|
38
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
39
|
-
if (key in exports && exports[key] === _DataTypes[key]) return;
|
|
40
|
-
Object.defineProperty(exports, key, {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
get: function () {
|
|
43
|
-
return _DataTypes[key];
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
var _GlobalErrorHandler = require("./GlobalErrorHandler");
|
|
48
|
-
Object.keys(_GlobalErrorHandler).forEach(function (key) {
|
|
49
|
-
if (key === "default" || key === "__esModule") return;
|
|
50
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
51
|
-
if (key in exports && exports[key] === _GlobalErrorHandler[key]) return;
|
|
52
|
-
Object.defineProperty(exports, key, {
|
|
53
|
-
enumerable: true,
|
|
54
|
-
get: function () {
|
|
55
|
-
return _GlobalErrorHandler[key];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
var _UseWebTracking = require("./UseWebTracking");
|
|
60
|
-
var _promiseRejectionHandler = require("./promiseRejectionHandler");
|
|
61
|
-
Object.keys(_promiseRejectionHandler).forEach(function (key) {
|
|
62
|
-
if (key === "default" || key === "__esModule") return;
|
|
63
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
64
|
-
if (key in exports && exports[key] === _promiseRejectionHandler[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _promiseRejectionHandler[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_MappIntelligencePlugin","require","_Converters","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_DataTypes","_GlobalErrorHandler","_UseWebTracking","_promiseRejectionHandler"],"sourceRoot":"../../src","s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OAAA,CAAAL,GAAA,MAAAU,mBAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,mBAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,eAAA,GAAAhB,OAAA;AACA,IAAAiB,wBAAA,GAAAjB,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAc,wBAAA,EAAAb,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,MAAAY,wBAAA,CAAAZ,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,wBAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.setUnhandledPromiseRejectionTracker = exports.getUnhandledPromiseRejectionTracker = void 0;
|
|
7
|
-
const {
|
|
8
|
-
polyfillGlobal
|
|
9
|
-
} = require('react-native/Libraries/Utilities/PolyfillFunctions');
|
|
10
|
-
const Promise = require('promise/setimmediate/es6-extensions');
|
|
11
|
-
require('promise/setimmediate/done');
|
|
12
|
-
require('promise/setimmediate/finally');
|
|
13
|
-
const tracking = require('promise/setimmediate/rejection-tracking');
|
|
14
|
-
|
|
15
|
-
//@ts-ignore
|
|
16
|
-
const defaultHandler = (id, error) => {
|
|
17
|
-
error = error === undefined ? {} : error;
|
|
18
|
-
let message;
|
|
19
|
-
let stack;
|
|
20
|
-
const stringValue = Object.prototype.toString.call(error);
|
|
21
|
-
if (stringValue === '[object Error]') {
|
|
22
|
-
message = Error.prototype.toString.call(error);
|
|
23
|
-
stack = error.stack;
|
|
24
|
-
} else {
|
|
25
|
-
try {
|
|
26
|
-
message = require('pretty-format')(error);
|
|
27
|
-
} catch {
|
|
28
|
-
message = typeof error === 'string' ? error : JSON.stringify(error);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
const warning = `Possible Unhandled Promise Rejection (id: ${id}):\n` + `${message}\n` + (stack == null ? '' : stack);
|
|
32
|
-
console.warn(warning);
|
|
33
|
-
};
|
|
34
|
-
let handler = defaultHandler;
|
|
35
|
-
const getUnhandledPromiseRejectionTracker = () => handler;
|
|
36
|
-
|
|
37
|
-
//@ts-ignore
|
|
38
|
-
exports.getUnhandledPromiseRejectionTracker = getUnhandledPromiseRejectionTracker;
|
|
39
|
-
const setUnhandledPromiseRejectionTracker = tracker => {
|
|
40
|
-
handler = tracker;
|
|
41
|
-
polyfillGlobal('Promise', () => {
|
|
42
|
-
tracking.enable({
|
|
43
|
-
allRejections: true,
|
|
44
|
-
onUnhandled: tracker
|
|
45
|
-
});
|
|
46
|
-
return Promise;
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
exports.setUnhandledPromiseRejectionTracker = setUnhandledPromiseRejectionTracker;
|
|
50
|
-
//# sourceMappingURL=promiseRejectionHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["Object","defineProperty","exports","value","setUnhandledPromiseRejectionTracker","getUnhandledPromiseRejectionTracker","polyfillGlobal","require","Promise","tracking","defaultHandler","id","error","undefined","message","stack","stringValue","prototype","toString","call","Error","JSON","stringify","warning","console","warn","handler","tracker","enable","allRejections","onUnhandled"],"sourceRoot":"../../src","sources":["promiseRejectionHandler.tsx"],"mappings":"AAAA,YAAY;;AAACA,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,KAAA;A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