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
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
build(): Promise<number>;
|
|
6
|
+
initWithConfiguration(trackIDs: number[], domain: string): Promise<number>;
|
|
7
|
+
setLogLevel(level: number): Promise<number>;
|
|
8
|
+
setExceptionLogLevel(level: number): Promise<number>;
|
|
9
|
+
setRequestInterval(interval: number): Promise<number>;
|
|
10
|
+
setBatchSupportEnabled(enabled: boolean): Promise<number>;
|
|
11
|
+
setEnableBackgroundSendout(enabled: boolean): Promise<number>;
|
|
12
|
+
setBatchSupportSize(size: number): Promise<number>;
|
|
13
|
+
setRequestPerQueue(numberOfRequests: number): Promise<number>;
|
|
14
|
+
setShouldMigrate(migrate: boolean): Promise<number>;
|
|
15
|
+
setAnonymousTracking(anonymous: boolean): Promise<number>;
|
|
16
|
+
setSendAppVersionInEveryRequest(flag: boolean): Promise<number>;
|
|
17
|
+
setEnableUserMatching(enabled: boolean): Promise<number>;
|
|
18
|
+
trackPage(pageTitle: string): Promise<number>;
|
|
19
|
+
trackCustomPage(
|
|
20
|
+
pageTitle: string,
|
|
21
|
+
pageParameters: Object,
|
|
22
|
+
sessionParameters: Object,
|
|
23
|
+
userCategories: Object,
|
|
24
|
+
ecommerceParameters: Object,
|
|
25
|
+
campaignParameters: Object
|
|
26
|
+
): Promise<number>;
|
|
27
|
+
trackPageWithCustomData(
|
|
28
|
+
pageParameters: { [key: string]: string },
|
|
29
|
+
pageTitle: string
|
|
30
|
+
): Promise<number>;
|
|
31
|
+
trackAction(
|
|
32
|
+
name: string,
|
|
33
|
+
eventParameters: Object,
|
|
34
|
+
sessionParameters: Object,
|
|
35
|
+
userCategories: Object,
|
|
36
|
+
ecommerceParameters: Object,
|
|
37
|
+
campaignParameters: Object
|
|
38
|
+
): Promise<number>;
|
|
39
|
+
trackUrl(url: string, mediaCode?: string): Promise<number>;
|
|
40
|
+
trackMedia(mediaEvent: Object): Promise<number>;
|
|
41
|
+
trackException(name: string, message: string, stackTrace?: string): Promise<number>;
|
|
42
|
+
trackExceptionWithName(name: string, message: string, stackTrace?: string): Promise<number>;
|
|
43
|
+
setEverId(everId?: string): Promise<number>;
|
|
44
|
+
getEverId(): Promise<string>;
|
|
45
|
+
isInitialized(): Promise<boolean>;
|
|
46
|
+
setTemporarySessionId(sessionId?: string): Promise<number>;
|
|
47
|
+
optOut(sendData: boolean): Promise<number>;
|
|
48
|
+
optIn(sendData: boolean): Promise<number>;
|
|
49
|
+
reset(): Promise<number>;
|
|
50
|
+
sendRequestsAndClean(): Promise<number>;
|
|
51
|
+
getCurrentConfig(): Promise<string>;
|
|
52
|
+
nativeCrash(): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('MappinteligencePlugin');
|
package/src/UseWebTracking.tsx
CHANGED
|
@@ -21,30 +21,8 @@ export const useWebTracking = (
|
|
|
21
21
|
) => {
|
|
22
22
|
const webViewRef = useRef<WebView>(null);
|
|
23
23
|
|
|
24
|
-
const handleMessage = useCallback(
|
|
25
|
-
(event: WebViewMessageEvent) => {
|
|
26
|
-
try {
|
|
27
|
-
const message = JSON.parse(event.nativeEvent.data);
|
|
28
|
-
const method = message.method;
|
|
29
|
-
const name = message.name;
|
|
30
|
-
const params = message.params;
|
|
31
24
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if (method === 'trackCustomPage') {
|
|
35
|
-
trackCustomPage(name, params);
|
|
36
|
-
} else if (method === 'trackCustomEvent') {
|
|
37
|
-
trackCustomEvent(name, params);
|
|
38
|
-
}
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.error('Error parsing message from WebView', error);
|
|
41
|
-
}
|
|
42
|
-
onMessage?.(event.nativeEvent.data);
|
|
43
|
-
},
|
|
44
|
-
[onMessage]
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
const trackCustomPage = (name: string, params: any) => {
|
|
25
|
+
const trackCustomPage = useCallback((name: string, params: any) => {
|
|
48
26
|
try {
|
|
49
27
|
const parameters = getJson(params);
|
|
50
28
|
console.log('Page Name: ', name, '; Params: ', parameters);
|
|
@@ -52,9 +30,9 @@ export const useWebTracking = (
|
|
|
52
30
|
} catch (error) {
|
|
53
31
|
console.error(error);
|
|
54
32
|
}
|
|
55
|
-
};
|
|
33
|
+
}, []);
|
|
56
34
|
|
|
57
|
-
const trackCustomEvent = (name: string, params: any) => {
|
|
35
|
+
const trackCustomEvent = useCallback((name: string, params: any) => {
|
|
58
36
|
try {
|
|
59
37
|
const parameters = getJson(params);
|
|
60
38
|
console.log('Event Name: ', name, '; Params: ', parameters);
|
|
@@ -69,7 +47,31 @@ export const useWebTracking = (
|
|
|
69
47
|
} catch (error) {
|
|
70
48
|
console.error(error);
|
|
71
49
|
}
|
|
72
|
-
};
|
|
50
|
+
}, []);
|
|
51
|
+
|
|
52
|
+
const handleMessage = useCallback(
|
|
53
|
+
(event: WebViewMessageEvent) => {
|
|
54
|
+
try {
|
|
55
|
+
const message = JSON.parse(event.nativeEvent.data);
|
|
56
|
+
const method = message.method;
|
|
57
|
+
const name = message.name;
|
|
58
|
+
const params = message.params;
|
|
59
|
+
|
|
60
|
+
console.log(method, name, params);
|
|
61
|
+
|
|
62
|
+
if (method === 'trackCustomPage') {
|
|
63
|
+
trackCustomPage(name, params);
|
|
64
|
+
} else if (method === 'trackCustomEvent') {
|
|
65
|
+
trackCustomEvent(name, params);
|
|
66
|
+
}
|
|
67
|
+
} catch (error) {
|
|
68
|
+
console.error('Error parsing message from WebView', error);
|
|
69
|
+
}
|
|
70
|
+
onMessage?.(event.nativeEvent.data);
|
|
71
|
+
},
|
|
72
|
+
[onMessage, trackCustomPage, trackCustomEvent]
|
|
73
|
+
);
|
|
74
|
+
|
|
73
75
|
|
|
74
76
|
const getJson = (data?: any | null): any => {
|
|
75
77
|
try {
|
|
@@ -106,7 +108,7 @@ export const useWebTracking = (
|
|
|
106
108
|
if (onLoad) {
|
|
107
109
|
onLoad();
|
|
108
110
|
}
|
|
109
|
-
}, []);
|
|
111
|
+
}, [onLoad]);
|
|
110
112
|
|
|
111
113
|
const getInjectedJavaScript = (script?: string | undefined | null) => {
|
|
112
114
|
if (script) {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const {
|
|
4
|
-
polyfillGlobal,
|
|
5
|
-
} = require('react-native/Libraries/Utilities/PolyfillFunctions');
|
|
6
3
|
const Promise = require('promise/setimmediate/es6-extensions');
|
|
7
4
|
|
|
8
5
|
require('promise/setimmediate/done');
|
|
@@ -43,12 +40,10 @@ export const getUnhandledPromiseRejectionTracker = () => handler;
|
|
|
43
40
|
export const setUnhandledPromiseRejectionTracker = (tracker) => {
|
|
44
41
|
handler = tracker;
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
onUnhandled: tracker,
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
return Promise;
|
|
43
|
+
tracking.enable({
|
|
44
|
+
allRejections: true,
|
|
45
|
+
onUnhandled: tracker,
|
|
53
46
|
});
|
|
47
|
+
|
|
48
|
+
(global as any).Promise = Promise;
|
|
54
49
|
};
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.convertCampaignParameters = convertCampaignParameters;
|
|
7
|
-
exports.convertEcommerceParameters = convertEcommerceParameters;
|
|
8
|
-
exports.convertEventParameters = convertEventParameters;
|
|
9
|
-
exports.convertMediaEvent = convertMediaEvent;
|
|
10
|
-
exports.convertMediaParameters = convertMediaParameters;
|
|
11
|
-
exports.convertPageParameters = convertPageParameters;
|
|
12
|
-
exports.convertSessionParamters = convertSessionParamters;
|
|
13
|
-
exports.convertUserCategories = convertUserCategories;
|
|
14
|
-
//MARK: methods for converting objects
|
|
15
|
-
function convertUserCategories(userCategories) {
|
|
16
|
-
if (userCategories == null) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
console.log('convertUserCategories');
|
|
20
|
-
const birthday = userCategories?.birthday;
|
|
21
|
-
const categories = userCategories?.customCategories;
|
|
22
|
-
const userCategorisesDict = {
|
|
23
|
-
birthday: birthday != null ? {
|
|
24
|
-
day: birthday.day,
|
|
25
|
-
month: birthday.month,
|
|
26
|
-
year: birthday.year
|
|
27
|
-
} : null,
|
|
28
|
-
city: userCategories?.city,
|
|
29
|
-
country: userCategories?.country,
|
|
30
|
-
emailAddress: userCategories?.emailAddress,
|
|
31
|
-
emailReceiverId: userCategories?.emailReceiverId,
|
|
32
|
-
firstName: userCategories?.firstName,
|
|
33
|
-
gender: userCategories?.gender,
|
|
34
|
-
customerId: userCategories?.customerId,
|
|
35
|
-
lastName: userCategories?.lastName,
|
|
36
|
-
newsletterSubscribed: userCategories?.newsletterSubscribed,
|
|
37
|
-
phoneNumber: userCategories?.phoneNumber,
|
|
38
|
-
street: userCategories?.street,
|
|
39
|
-
streetNumber: userCategories?.streetNumber,
|
|
40
|
-
zipCode: userCategories?.zipCode,
|
|
41
|
-
customCategories: categories != null ? Object.fromEntries(categories.entries()) : null
|
|
42
|
-
};
|
|
43
|
-
return userCategorisesDict;
|
|
44
|
-
}
|
|
45
|
-
function convertPageParameters(pageParameters) {
|
|
46
|
-
console.log('convertPageParameters');
|
|
47
|
-
if (pageParameters == null) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const params = pageParameters?.params;
|
|
51
|
-
const cat = pageParameters?.categories;
|
|
52
|
-
const page = {
|
|
53
|
-
params: params != null ? Object.fromEntries(params.entries()) : {},
|
|
54
|
-
categories: cat != null ? Object.fromEntries(cat) : {},
|
|
55
|
-
searchTerm: pageParameters?.searchTerm
|
|
56
|
-
};
|
|
57
|
-
return page;
|
|
58
|
-
}
|
|
59
|
-
function convertSessionParamters(sessionParamaters) {
|
|
60
|
-
console.log('convertSessionParamters');
|
|
61
|
-
if (sessionParamaters == null) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
const data = sessionParamaters?.parameters;
|
|
65
|
-
return data != null ? Object.fromEntries(data.entries()) : {};
|
|
66
|
-
}
|
|
67
|
-
function convertEcommerceParameters(ecommerceParameters) {
|
|
68
|
-
console.log('convertEcommerceParameters');
|
|
69
|
-
if (ecommerceParameters == null) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
let products = [];
|
|
73
|
-
ecommerceParameters.products?.map(item => {
|
|
74
|
-
let categories = item.categories;
|
|
75
|
-
let ecommercParams = item.ecommerceParameters;
|
|
76
|
-
products.push({
|
|
77
|
-
name: item?.name,
|
|
78
|
-
cost: item.cost,
|
|
79
|
-
quantity: item.quantity,
|
|
80
|
-
productAdvertiseID: item.productAdvertiseID,
|
|
81
|
-
productSoldOut: item.productSoldOut,
|
|
82
|
-
productVariant: item.productVariant,
|
|
83
|
-
categories: categories != null ? Object.fromEntries(categories.entries()) : {},
|
|
84
|
-
ecommerceParameters: ecommercParams != null ? Object.fromEntries(ecommercParams.entries()) : {}
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
const customParams = ecommerceParameters.customParameters;
|
|
88
|
-
const ecommerce = {
|
|
89
|
-
products: products,
|
|
90
|
-
status: ecommerceParameters.status,
|
|
91
|
-
currency: ecommerceParameters.currency,
|
|
92
|
-
orderID: ecommerceParameters.orderID,
|
|
93
|
-
orderValue: ecommerceParameters.orderValue,
|
|
94
|
-
returningOrNewCustomer: ecommerceParameters.returningOrNewCustomer,
|
|
95
|
-
returnValue: ecommerceParameters.returnValue,
|
|
96
|
-
cancellationValue: ecommerceParameters.cancellationValue,
|
|
97
|
-
couponValue: ecommerceParameters.couponValue,
|
|
98
|
-
paymentMethod: ecommerceParameters.paymentMethod,
|
|
99
|
-
shippingServiceProvider: ecommerceParameters.shippingServiceProvider,
|
|
100
|
-
shippingSpeed: ecommerceParameters.shippingSpeed,
|
|
101
|
-
shippingCost: ecommerceParameters.shippingCost,
|
|
102
|
-
markUp: ecommerceParameters.markUp,
|
|
103
|
-
orderStatus: ecommerceParameters.orderStatus,
|
|
104
|
-
customParameters: customParams != null ? Object.fromEntries(customParams.entries()) : {}
|
|
105
|
-
};
|
|
106
|
-
return ecommerce;
|
|
107
|
-
}
|
|
108
|
-
function convertCampaignParameters(campaignParameters) {
|
|
109
|
-
console.log('convertCampaignParameters');
|
|
110
|
-
if (campaignParameters == null) {
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
const params = campaignParameters?.customParameters;
|
|
114
|
-
const campaign = {
|
|
115
|
-
campaignId: campaignParameters?.campaignId,
|
|
116
|
-
action: campaignParameters?.action,
|
|
117
|
-
mediaCode: campaignParameters?.mediaCode,
|
|
118
|
-
oncePerSession: campaignParameters?.oncePerSession,
|
|
119
|
-
customParameters: params != null ? Object.fromEntries(params.entries()) : {}
|
|
120
|
-
};
|
|
121
|
-
return campaign;
|
|
122
|
-
}
|
|
123
|
-
function convertEventParameters(event) {
|
|
124
|
-
if (event == null) {
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
const customParams = event.customParameters != null ? Object.fromEntries(event.customParameters?.entries()) : null;
|
|
128
|
-
const eventParams = {
|
|
129
|
-
customParameters: customParams
|
|
130
|
-
};
|
|
131
|
-
return eventParams;
|
|
132
|
-
}
|
|
133
|
-
function convertMediaParameters(mediaParam) {
|
|
134
|
-
if (mediaParam == null) {
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
const params = {
|
|
138
|
-
name: mediaParam?.name,
|
|
139
|
-
action: mediaParam?.action,
|
|
140
|
-
position: mediaParam?.position,
|
|
141
|
-
duration: mediaParam?.duration,
|
|
142
|
-
bandwith: mediaParam?.bandwith,
|
|
143
|
-
soundIsMuted: mediaParam?.soundIsMuted,
|
|
144
|
-
soundVolume: mediaParam?.soundVolume,
|
|
145
|
-
customCategories: mediaParam?.customCategories != null ? Object.fromEntries(mediaParam.customCategories?.entries()) : null
|
|
146
|
-
};
|
|
147
|
-
return params;
|
|
148
|
-
}
|
|
149
|
-
function convertMediaEvent(mediaEvent) {
|
|
150
|
-
if (mediaEvent == null) {
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
const custom = mediaEvent.customParameters != null ? Object.fromEntries(mediaEvent?.customParameters?.entries()) : null;
|
|
154
|
-
const eCommerce = convertEcommerceParameters(mediaEvent.eCommerceParameters);
|
|
155
|
-
const session = convertSessionParamters(mediaEvent.sessionParameters);
|
|
156
|
-
const event = convertEventParameters(mediaEvent.eventParameters);
|
|
157
|
-
const mediaParams = convertMediaParameters(mediaEvent.parameters);
|
|
158
|
-
const data = {
|
|
159
|
-
pageName: mediaEvent.pageName,
|
|
160
|
-
parameters: mediaParams,
|
|
161
|
-
eventParameters: event,
|
|
162
|
-
sessionParameters: session,
|
|
163
|
-
eCommerceParameters: eCommerce,
|
|
164
|
-
customParameters: custom
|
|
165
|
-
};
|
|
166
|
-
return data;
|
|
167
|
-
}
|
|
168
|
-
//# sourceMappingURL=Converters.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["convertUserCategories","userCategories","console","log","birthday","categories","customCategories","userCategorisesDict","day","month","year","city","country","emailAddress","emailReceiverId","firstName","gender","customerId","lastName","newsletterSubscribed","phoneNumber","street","streetNumber","zipCode","Object","fromEntries","entries","convertPageParameters","pageParameters","params","cat","page","searchTerm","convertSessionParamters","sessionParamaters","data","parameters","convertEcommerceParameters","ecommerceParameters","products","map","item","ecommercParams","push","name","cost","quantity","productAdvertiseID","productSoldOut","productVariant","customParams","customParameters","ecommerce","status","currency","orderID","orderValue","returningOrNewCustomer","returnValue","cancellationValue","couponValue","paymentMethod","shippingServiceProvider","shippingSpeed","shippingCost","markUp","orderStatus","convertCampaignParameters","campaignParameters","campaign","campaignId","action","mediaCode","oncePerSession","convertEventParameters","event","eventParams","convertMediaParameters","mediaParam","position","duration","bandwith","soundIsMuted","soundVolume","convertMediaEvent","mediaEvent","custom","eCommerce","eCommerceParameters","session","sessionParameters","eventParameters","mediaParams","pageName"],"sourceRoot":"../../src","sources":["Converters.tsx"],"mappings":";;;;;;;;;;;;;AAWA;AACO,SAASA,qBAAqBA,CAACC,cAAsC,EAAE;EAC5E,IAAIA,cAAc,IAAI,IAAI,EAAE;IAC1B,OAAO,IAAI;EACb;EACAC,OAAO,CAACC,GAAG,CAAC,uBAAuB,CAAC;EACpC,MAAMC,QAAQ,GAAGH,cAAc,EAAEG,QAAQ;EACzC,MAAMC,UAAU,GAAGJ,cAAc,EAAEK,gBAAgB;EAEnD,MAAMC,mBAA2B,GAAG;IAClCH,QAAQ,EACNA,QAAQ,IAAI,IAAI,GACZ;MAAEI,GAAG,EAAEJ,QAAQ,CAACI,GAAG;MAAEC,KAAK,EAAEL,QAAQ,CAACK,KAAK;MAAEC,IAAI,EAAEN,QAAQ,CAACM;IAAK,CAAC,GACjE,IAAI;IACVC,IAAI,EAAEV,cAAc,EAAEU,IAAI;IAC1BC,OAAO,EAAEX,cAAc,EAAEW,OAAO;IAChCC,YAAY,EAAEZ,cAAc,EAAEY,YAAY;IAC1CC,eAAe,EAAEb,cAAc,EAAEa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I,IAAI,GAC/B3B,MAAM,CAACC,WAAW,CAAC4D,UAAU,EAAElC,gBAAgB,EAAEzB,OAAO,CAAC,CAAC,CAAC,GAC3D,IAAI;EACV,MAAM6D,SAAS,GAAGlD,0BAA0B,CAACgD,UAAU,CAACG,mBAAmB,CAAC;EAC5E,MAAMC,OAAO,GAAGxD,uBAAuB,CAACoD,UAAU,CAACK,iBAAiB,CAAC;EACrE,MAAMf,KAAK,GAAGD,sBAAsB,CAACW,UAAU,CAACM,eAAe,CAAC;EAChE,MAAMC,WAAW,GAAGf,sBAAsB,CAACQ,UAAU,CAACjD,UAAU,CAAC;EAEjE,MAAMD,IAAY,GAAG;IACnB0D,QAAQ,EAAER,UAAU,CAACQ,QAAQ;IAC7BzD,UAAU,EAAEwD,WAAW;IACvBD,eAAe,EAAEhB,KAAK;IACtBe,iBAAiB,EAAED,OAAO;IAC1BD,mBAAmB,EAAED,SAAS;IAC9BpC,gBAAgB,EAAEmC;EACpB,CAAC;EAED,OAAOnD,IAAI;AACb","ignoreList":[]}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.MediaParam = exports.MediaAction = exports.MIStatus = exports.MIGender = exports.MIAction = exports.LogLevel = exports.ExceptionType = void 0;
|
|
7
|
-
let MIGender = exports.MIGender = /*#__PURE__*/function (MIGender) {
|
|
8
|
-
MIGender[MIGender["unknown"] = 1] = "unknown";
|
|
9
|
-
MIGender[MIGender["male"] = 2] = "male";
|
|
10
|
-
MIGender[MIGender["female"] = 3] = "female";
|
|
11
|
-
return MIGender;
|
|
12
|
-
}({});
|
|
13
|
-
let MIStatus = exports.MIStatus = /*#__PURE__*/function (MIStatus) {
|
|
14
|
-
MIStatus[MIStatus["noneStatus"] = 0] = "noneStatus";
|
|
15
|
-
MIStatus[MIStatus["addedToBasket"] = 1] = "addedToBasket";
|
|
16
|
-
MIStatus[MIStatus["purchased"] = 2] = "purchased";
|
|
17
|
-
MIStatus[MIStatus["viewed"] = 3] = "viewed";
|
|
18
|
-
MIStatus[MIStatus["deletedFromBasket"] = 4] = "deletedFromBasket";
|
|
19
|
-
MIStatus[MIStatus["addedToWishlist"] = 5] = "addedToWishlist";
|
|
20
|
-
MIStatus[MIStatus["deletedFromWishlist"] = 6] = "deletedFromWishlist";
|
|
21
|
-
MIStatus[MIStatus["checkout"] = 7] = "checkout";
|
|
22
|
-
return MIStatus;
|
|
23
|
-
}({});
|
|
24
|
-
let MIAction = exports.MIAction = /*#__PURE__*/function (MIAction) {
|
|
25
|
-
MIAction[MIAction["click"] = 1] = "click";
|
|
26
|
-
MIAction[MIAction["view"] = 2] = "view";
|
|
27
|
-
return MIAction;
|
|
28
|
-
}({});
|
|
29
|
-
let MediaParam = exports.MediaParam = /*#__PURE__*/function (MediaParam) {
|
|
30
|
-
MediaParam["media_category"] = "mg";
|
|
31
|
-
MediaParam["media_action"] = "mk";
|
|
32
|
-
MediaParam["media_position"] = "mt1";
|
|
33
|
-
MediaParam["media_duration"] = "mt2";
|
|
34
|
-
MediaParam["bandwidth"] = "bw";
|
|
35
|
-
MediaParam["volume"] = "vol";
|
|
36
|
-
MediaParam["mute"] = "mut";
|
|
37
|
-
MediaParam["name"] = "mi";
|
|
38
|
-
return MediaParam;
|
|
39
|
-
}({});
|
|
40
|
-
let ExceptionType = exports.ExceptionType = /*#__PURE__*/function (ExceptionType) {
|
|
41
|
-
ExceptionType[ExceptionType["none"] = 0] = "none";
|
|
42
|
-
ExceptionType[ExceptionType["uncaught"] = 1] = "uncaught";
|
|
43
|
-
ExceptionType[ExceptionType["caught"] = 2] = "caught";
|
|
44
|
-
ExceptionType[ExceptionType["custom"] = 3] = "custom";
|
|
45
|
-
ExceptionType[ExceptionType["all"] = 4] = "all";
|
|
46
|
-
ExceptionType[ExceptionType["uncaught_and_custom"] = 5] = "uncaught_and_custom";
|
|
47
|
-
ExceptionType[ExceptionType["uncaught_and_caught"] = 6] = "uncaught_and_caught";
|
|
48
|
-
ExceptionType[ExceptionType["custom_and_caught"] = 7] = "custom_and_caught";
|
|
49
|
-
return ExceptionType;
|
|
50
|
-
}({});
|
|
51
|
-
let MediaAction = exports.MediaAction = /*#__PURE__*/function (MediaAction) {
|
|
52
|
-
MediaAction["init"] = "init";
|
|
53
|
-
MediaAction["play"] = "play";
|
|
54
|
-
MediaAction["pause"] = "pause";
|
|
55
|
-
MediaAction["stop"] = "stop";
|
|
56
|
-
MediaAction["seek"] = "seek";
|
|
57
|
-
MediaAction["pos"] = "pos";
|
|
58
|
-
MediaAction["eof"] = "eof";
|
|
59
|
-
return MediaAction;
|
|
60
|
-
}({});
|
|
61
|
-
let LogLevel = exports.LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
62
|
-
LogLevel[LogLevel["all"] = 1] = "all";
|
|
63
|
-
// All logs of the above.
|
|
64
|
-
LogLevel[LogLevel["debug"] = 2] = "debug";
|
|
65
|
-
// The lowest priority that you would normally log, and purely
|
|
66
|
-
// informational in nature.
|
|
67
|
-
LogLevel[LogLevel["warning"] = 3] = "warning";
|
|
68
|
-
// Something is missing and might fail if not corrected
|
|
69
|
-
LogLevel[LogLevel["error"] = 4] = "error";
|
|
70
|
-
// Something has failed.
|
|
71
|
-
LogLevel[LogLevel["fault"] = 5] = "fault";
|
|
72
|
-
// A failure in a key system.
|
|
73
|
-
LogLevel[LogLevel["info"] = 6] = "info";
|
|
74
|
-
// Informational logs for updating configuration or migrating from
|
|
75
|
-
// older versions of the library.
|
|
76
|
-
LogLevel[LogLevel["none"] = 7] = "none"; // None of the logs.
|
|
77
|
-
return LogLevel;
|
|
78
|
-
}({});
|
|
79
|
-
//# sourceMappingURL=DataTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["MIGender","exports","MIStatus","MIAction","MediaParam","ExceptionType","MediaAction","LogLevel"],"sourceRoot":"../../src","sources":["DataTypes.tsx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;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAAA,IAUXC,QAAQ,GAAAN,OAAA,CAAAM,QAAA,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EACT;EADCA,QAAQ,CAARA,QAAQ;EAEP;EACX;EAHUA,QAAQ,CAARA,QAAQ;EAIL;EAJHA,QAAQ,CAARA,QAAQ;EAKP;EALDA,QAAQ,CAARA,QAAQ;EAMP;EANDA,QAAQ,CAARA,QAAQ;EAOR;EACV;EARUA,QAAQ,CAARA,QAAQ,wBASR;EAAA,OATAA,QAAQ;AAAA","ignoreList":[]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.setGlobalErrorHandler = void 0;
|
|
7
|
-
var _mappIntelligenceReactnativePlugin = require("mapp-intelligence-reactnative-plugin");
|
|
8
|
-
const {
|
|
9
|
-
polyfillGlobal
|
|
10
|
-
} = require('react-native/Libraries/Utilities/PolyfillFunctions');
|
|
11
|
-
const Promise = require('promise/setimmediate/es6-extensions');
|
|
12
|
-
const tracking = require('promise/setimmediate/rejection-tracking');
|
|
13
|
-
var onErrorCallback = null;
|
|
14
|
-
const defaultErrorHandler = (error, isFatal) => {
|
|
15
|
-
try {
|
|
16
|
-
_mappIntelligenceReactnativePlugin.MappIntelligencePlugin.trackException(error, error.stackTrace);
|
|
17
|
-
console.log('GLOBAL ERROR HANDLER: ', isFatal, error);
|
|
18
|
-
} catch (err) {
|
|
19
|
-
console.error(err);
|
|
20
|
-
} finally {
|
|
21
|
-
onErrorCallback?.(error, isFatal ?? false);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const setGlobalErrorHandler = (errorCallback, errorHandler = defaultErrorHandler) => {
|
|
25
|
-
onErrorCallback = errorCallback;
|
|
26
|
-
polyfillGlobal('Promise', () => {
|
|
27
|
-
tracking.enable({
|
|
28
|
-
allRejections: true,
|
|
29
|
-
onUnhandled: (_, error) => {
|
|
30
|
-
errorHandler(error, false);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return Promise;
|
|
34
|
-
});
|
|
35
|
-
ErrorUtils.setGlobalHandler(errorHandler);
|
|
36
|
-
// const prevTracker = getUnhandledPromiseRejectionTracker();
|
|
37
|
-
|
|
38
|
-
// setUnhandledPromiseRejectionTracker((id: any, error: any) => {
|
|
39
|
-
// console.warn('Unhandled promise rejection!', id, error);
|
|
40
|
-
// if (prevTracker !== undefined) {
|
|
41
|
-
// //prevTracker(id, error);
|
|
42
|
-
// errorHandler(error, false);
|
|
43
|
-
// }
|
|
44
|
-
// });
|
|
45
|
-
};
|
|
46
|
-
exports.setGlobalErrorHandler = setGlobalErrorHandler;
|
|
47
|
-
//# sourceMappingURL=GlobalErrorHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_mappIntelligenceReactnativePlugin","require","polyfillGlobal","Promise","tracking","onErrorCallback","defaultErrorHandler","error","isFatal","MappIntelligencePlugin","trackException","stackTrace","console","log","err","setGlobalErrorHandler","errorCallback","errorHandler","enable","allRejections","onUnhandled","_","ErrorUtils","setGlobalHandler","exports"],"sourceRoot":"../../src","sources":["GlobalErrorHandler.tsx"],"mappings":";;;;;;AAAA,IAAAA,kCAAA,GAAAC,OAAA;AAEA,MAAM;EACJC;AACF,CAAC,GAAGD,OAAO,CAAC,oDAAoD,CAAC;AACjE,MAAME,OAAO,GAAGF,OAAO,CAAC,qCAAqC,CAAC;AAC9D,MAAMG,QAAQ,GAAGH,OAAO,CAAC,yCAAyC,CAAC;AAOnE,IAAII,eAAwE,GAC1E,IAAI;AAEN,MAAMC,mBAAuC,GAAGA,CAACC,KAAK,EAAEC,OAAO,KAAK;EAClE,IAAI;IACFC,yDAAsB,CAACC,cAAc,CAACH,KAAK,EAAEA,KAAK,CAACI,UAAU,CAAC;IAC9DC,OAAO,CAACC,GAAG,CAAC,wBAAwB,EAAEL,OAAO,EAAED,KAAK,CAAC;EACvD,CAAC,CAAC,OAAOO,GAAG,EAAE;IACZF,OAAO,CAACL,KAAK,CAACO,GAAG,CAAC;EACpB,CAAC,SAAS;IACRT,eAAe,GAAGE,KAAK,EAAEC,OAAO,IAAI,KAAK,CAAC;EAC5C;AACF,CAAC;AAEM,MAAMO,qBAAqB,GAAGA,CACnCC,aAAuE,EACvEC,YAAgC,GAAGX,mBAAmB,KAC7C;EACTD,eAAe,GAAGW,aAAa;EAE/Bd,cAAc,CAAC,SAAS,EAAE,MAAM;IAC9BE,QAAQ,CAACc,MAAM,CAAC;MACdC,aAAa,EAAE,IAAI;MACnBC,WAAW,EAAEA,CAACC,CAAS,EAAEd,KAAc,KAAK;QAC1CU,YAAY,CAACV,KAAK,EAAE,KAAK,CAAC;MAC5B;IACF,CAAC,CAAC;IAEF,OAAOJ,OAAO;EAChB,CAAC,CAAC;EAEFmB,UAAU,CAACC,gBAAgB,CAACN,YAAY,CAAC;EACzC;;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;AACF,CAAC;AAACO,OAAA,CAAAT,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|