@convep_mobilogy/react-native-qms-plugin 0.10.4 → 0.10.5
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/ios/QmsPlugin/QmsDashboardViewManager.mm +373 -2
- package/ios/QmsPlugin/QmsModule.mm +220 -0
- package/ios/QmsPlugin/UIViewController+QmsAnalytics.m +276 -19
- package/ios/QmsPluginFramework.xcframework/Info.plist +5 -5
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/Assets.car +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/Info.plist +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/QmsPluginFramework +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/_CodeSignature/CodeResources +3 -3
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/Assets.car +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/Info.plist +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/QmsPluginFramework +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/_CodeSignature/CodeResources +3 -3
- package/lib/module/QmsDashboardView.ios.js +27 -11
- package/lib/module/QmsDashboardView.ios.js.map +1 -1
- package/lib/typescript/src/QmsDashboardView.ios.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/QmsDashboardView.ios.tsx +36 -23
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useEffect } from 'react';
|
|
4
|
-
import { NativeEventEmitter, NativeModules, requireNativeComponent } from 'react-native';
|
|
4
|
+
import { DeviceEventEmitter, NativeEventEmitter, NativeModules, requireNativeComponent } from 'react-native';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
// Make sure your iOS native view manager is exported as "QmsDashboardView"
|
|
7
7
|
const NativeQmsDashboardView = requireNativeComponent('QmsDashboardView');
|
|
8
8
|
export const QmsDashboardView = props => {
|
|
9
9
|
const {
|
|
10
10
|
onClose,
|
|
11
|
+
onLogout,
|
|
11
12
|
onAnalyticsScreen,
|
|
12
13
|
onAnalyticsEvent,
|
|
13
|
-
// onLogout,
|
|
14
14
|
clientID,
|
|
15
15
|
clientCode,
|
|
16
16
|
ClientID,
|
|
@@ -18,18 +18,22 @@ export const QmsDashboardView = props => {
|
|
|
18
18
|
user_token,
|
|
19
19
|
userToken,
|
|
20
20
|
token,
|
|
21
|
-
|
|
21
|
+
isOrigin = false,
|
|
22
22
|
// autoShow is Android-only; ignored on iOS
|
|
23
|
+
themeColor,
|
|
23
24
|
headerThemeColor,
|
|
24
25
|
headerTextColor,
|
|
25
26
|
headerIconColor,
|
|
27
|
+
accentColor,
|
|
28
|
+
fontFamily = '',
|
|
29
|
+
payload,
|
|
26
30
|
...rest
|
|
27
31
|
} = props;
|
|
28
32
|
const resolvedClientID = clientID ?? ClientID ?? '';
|
|
29
33
|
const resolvedClientCode = clientCode ?? ClientCode ?? '';
|
|
30
34
|
const resolvedToken = user_token ?? token ?? userToken ?? '';
|
|
31
35
|
useEffect(() => {
|
|
32
|
-
if (!onClose && !
|
|
36
|
+
if (!onClose && !onLogout) return;
|
|
33
37
|
const nativeEmitterModule = NativeModules.QmsDashboardEmitter;
|
|
34
38
|
if (!nativeEmitterModule) return;
|
|
35
39
|
const emitter = new NativeEventEmitter(nativeEmitterModule);
|
|
@@ -37,21 +41,33 @@ export const QmsDashboardView = props => {
|
|
|
37
41
|
if (onClose) {
|
|
38
42
|
subscriptions.push(emitter.addListener('onClose', onClose));
|
|
39
43
|
}
|
|
40
|
-
if (
|
|
41
|
-
subscriptions.push(emitter.addListener('
|
|
42
|
-
}
|
|
43
|
-
if (onAnalyticsEvent) {
|
|
44
|
-
subscriptions.push(emitter.addListener('onAnalyticsEvent', payload => onAnalyticsEvent(payload?.eventName, payload?.params ?? null)));
|
|
44
|
+
if (onLogout) {
|
|
45
|
+
subscriptions.push(emitter.addListener('onLogout', onLogout));
|
|
45
46
|
}
|
|
46
47
|
return () => subscriptions.forEach(sub => sub.remove());
|
|
47
|
-
}, [onClose,
|
|
48
|
+
}, [onClose, onLogout]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (!onAnalyticsScreen) return;
|
|
51
|
+
const subscription = DeviceEventEmitter.addListener('QmsSdkOnAnalyticsScreen', payload => onAnalyticsScreen(payload?.screenName, payload?.screenClass));
|
|
52
|
+
return () => subscription.remove();
|
|
53
|
+
}, [onAnalyticsScreen]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (!onAnalyticsEvent) return;
|
|
56
|
+
const subscription = DeviceEventEmitter.addListener('QmsSdkOnAnalyticsEvent', payload => onAnalyticsEvent(payload?.eventName, payload?.params ?? null));
|
|
57
|
+
return () => subscription.remove();
|
|
58
|
+
}, [onAnalyticsEvent]);
|
|
48
59
|
return /*#__PURE__*/_jsx(NativeQmsDashboardView, {
|
|
49
60
|
...rest,
|
|
50
61
|
ClientID: resolvedClientID,
|
|
51
62
|
ClientCode: resolvedClientCode,
|
|
52
63
|
user_token: resolvedToken,
|
|
64
|
+
isOrigin: isOrigin,
|
|
65
|
+
themeColor: themeColor,
|
|
53
66
|
headerTextColor: headerThemeColor ?? headerTextColor,
|
|
54
|
-
headerIconColor: headerThemeColor ?? headerIconColor
|
|
67
|
+
headerIconColor: headerThemeColor ?? headerIconColor,
|
|
68
|
+
accentColor: accentColor,
|
|
69
|
+
fontFamily: fontFamily,
|
|
70
|
+
payload: payload ?? null
|
|
55
71
|
});
|
|
56
72
|
};
|
|
57
73
|
//# sourceMappingURL=QmsDashboardView.ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","NativeEventEmitter","NativeModules","requireNativeComponent","jsx","_jsx","NativeQmsDashboardView","QmsDashboardView","props","onClose","onAnalyticsScreen","onAnalyticsEvent","clientID","clientCode","ClientID","ClientCode","user_token","userToken","token","headerThemeColor","headerTextColor","headerIconColor","rest","resolvedClientID","resolvedClientCode","resolvedToken","nativeEmitterModule","QmsDashboardEmitter","emitter","subscriptions","push","addListener","
|
|
1
|
+
{"version":3,"names":["React","useEffect","DeviceEventEmitter","NativeEventEmitter","NativeModules","requireNativeComponent","jsx","_jsx","NativeQmsDashboardView","QmsDashboardView","props","onClose","onLogout","onAnalyticsScreen","onAnalyticsEvent","clientID","clientCode","ClientID","ClientCode","user_token","userToken","token","isOrigin","themeColor","headerThemeColor","headerTextColor","headerIconColor","accentColor","fontFamily","payload","rest","resolvedClientID","resolvedClientCode","resolvedToken","nativeEmitterModule","QmsDashboardEmitter","emitter","subscriptions","push","addListener","forEach","sub","remove","subscription","screenName","screenClass","eventName","params"],"sourceRoot":"../../src","sources":["QmsDashboardView.ios.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACEC,kBAAkB,EAClBC,kBAAkB,EAClBC,aAAa,EACbC,sBAAsB,QACjB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGtB;AACA,MAAMC,sBAAsB,GAC1BH,sBAAsB,CAAwB,kBAAkB,CAAC;AAEnE,OAAO,MAAMI,gBAAiD,GAAIC,KAAK,IAAK;EAC1E,MAAM;IACJC,OAAO;IACPC,QAAQ;IACRC,iBAAiB;IACjBC,gBAAgB;IAChBC,QAAQ;IACRC,UAAU;IACVC,QAAQ;IACRC,UAAU;IACVC,UAAU;IACVC,SAAS;IACTC,KAAK;IACLC,QAAQ,GAAG,KAAK;IAChB;IACAC,UAAU;IACVC,gBAAgB;IAChBC,eAAe;IACfC,eAAe;IACfC,WAAW;IACXC,UAAU,GAAG,EAAE;IACfC,OAAO;IACP,GAAGC;EACL,CAAC,GAAGpB,KAAK;EAET,MAAMqB,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YAAY,GAAGzC,kBAAkB,CAACqC,WAAW,CACjD,wBAAwB,EACvBV,OAAkE,IACjEf,gBAAgB,CAACe,OAAO,EAAEiB,SAAS,EAAEjB,OAAO,EAAEkB,MAAM,IAAI,IAAI,CAChE,CAAC;IACD,OAAO,MAAMJ,YAAY,CAACD,MAAM,CAAC,CAAC;EACpC,CAAC,EAAE,CAAC5B,gBAAgB,CAAC,CAAC;EAEtB,oBACEP,IAAA,CAACC,sBAAsB;IAAA,GACjBsB,IAAI;IACRb,QAAQ,EAAEc,gBAAiB;IAC3Bb,UAAU,EAAEc,kBAAmB;IAC/Bb,UAAU,EAAEc,aAAc;IAC1BX,QAAQ,EAAEA,QAAS;IACnBC,UAAU,EAAEA,UAAW;IACvBE,eAAe,EAAED,gBAAgB,IAAIC,eAAgB;IACrDC,eAAe,EAAEF,gBAAgB,IAAIE,eAAgB;IACrDC,WAAW,EAAEA,WAAY;IACzBC,UAAU,EAAEA,UAAW;IACvBC,OAAO,EAAEA,OAAO,IAAI;EAAK,CAC1B,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QmsDashboardView.ios.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"QmsDashboardView.ios.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAMtE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA+E5D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
2
|
import {
|
|
3
|
+
DeviceEventEmitter,
|
|
3
4
|
NativeEventEmitter,
|
|
4
5
|
NativeModules,
|
|
5
6
|
requireNativeComponent,
|
|
@@ -13,9 +14,9 @@ const NativeQmsDashboardView =
|
|
|
13
14
|
export const QmsDashboardView: React.FC<QmsDashboardViewProps> = (props) => {
|
|
14
15
|
const {
|
|
15
16
|
onClose,
|
|
17
|
+
onLogout,
|
|
16
18
|
onAnalyticsScreen,
|
|
17
19
|
onAnalyticsEvent,
|
|
18
|
-
// onLogout,
|
|
19
20
|
clientID,
|
|
20
21
|
clientCode,
|
|
21
22
|
ClientID,
|
|
@@ -23,11 +24,15 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = (props) => {
|
|
|
23
24
|
user_token,
|
|
24
25
|
userToken,
|
|
25
26
|
token,
|
|
26
|
-
|
|
27
|
+
isOrigin = false,
|
|
27
28
|
// autoShow is Android-only; ignored on iOS
|
|
29
|
+
themeColor,
|
|
28
30
|
headerThemeColor,
|
|
29
31
|
headerTextColor,
|
|
30
32
|
headerIconColor,
|
|
33
|
+
accentColor,
|
|
34
|
+
fontFamily = '',
|
|
35
|
+
payload,
|
|
31
36
|
...rest
|
|
32
37
|
} = props;
|
|
33
38
|
|
|
@@ -36,7 +41,7 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = (props) => {
|
|
|
36
41
|
const resolvedToken = user_token ?? token ?? userToken ?? '';
|
|
37
42
|
|
|
38
43
|
useEffect(() => {
|
|
39
|
-
if (!onClose && !
|
|
44
|
+
if (!onClose && !onLogout) return;
|
|
40
45
|
const nativeEmitterModule = NativeModules.QmsDashboardEmitter;
|
|
41
46
|
if (!nativeEmitterModule) return;
|
|
42
47
|
const emitter = new NativeEventEmitter(nativeEmitterModule);
|
|
@@ -44,28 +49,31 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = (props) => {
|
|
|
44
49
|
if (onClose) {
|
|
45
50
|
subscriptions.push(emitter.addListener('onClose', onClose));
|
|
46
51
|
}
|
|
47
|
-
if (
|
|
48
|
-
subscriptions.push(
|
|
49
|
-
emitter.addListener(
|
|
50
|
-
'onAnalyticsScreen',
|
|
51
|
-
(payload?: { screenName?: string; screenClass?: string }) =>
|
|
52
|
-
onAnalyticsScreen(payload?.screenName, payload?.screenClass)
|
|
53
|
-
)
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
if (onAnalyticsEvent) {
|
|
57
|
-
subscriptions.push(
|
|
58
|
-
emitter.addListener(
|
|
59
|
-
'onAnalyticsEvent',
|
|
60
|
-
(payload?: {
|
|
61
|
-
eventName?: string;
|
|
62
|
-
params?: Record<string, unknown>;
|
|
63
|
-
}) => onAnalyticsEvent(payload?.eventName, payload?.params ?? null)
|
|
64
|
-
)
|
|
65
|
-
);
|
|
52
|
+
if (onLogout) {
|
|
53
|
+
subscriptions.push(emitter.addListener('onLogout', onLogout));
|
|
66
54
|
}
|
|
67
55
|
return () => subscriptions.forEach((sub) => sub.remove());
|
|
68
|
-
}, [onClose,
|
|
56
|
+
}, [onClose, onLogout]);
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (!onAnalyticsScreen) return;
|
|
60
|
+
const subscription = DeviceEventEmitter.addListener(
|
|
61
|
+
'QmsSdkOnAnalyticsScreen',
|
|
62
|
+
(payload?: { screenName?: string; screenClass?: string }) =>
|
|
63
|
+
onAnalyticsScreen(payload?.screenName, payload?.screenClass)
|
|
64
|
+
);
|
|
65
|
+
return () => subscription.remove();
|
|
66
|
+
}, [onAnalyticsScreen]);
|
|
67
|
+
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
if (!onAnalyticsEvent) return;
|
|
70
|
+
const subscription = DeviceEventEmitter.addListener(
|
|
71
|
+
'QmsSdkOnAnalyticsEvent',
|
|
72
|
+
(payload?: { eventName?: string; params?: Record<string, unknown> }) =>
|
|
73
|
+
onAnalyticsEvent(payload?.eventName, payload?.params ?? null)
|
|
74
|
+
);
|
|
75
|
+
return () => subscription.remove();
|
|
76
|
+
}, [onAnalyticsEvent]);
|
|
69
77
|
|
|
70
78
|
return (
|
|
71
79
|
<NativeQmsDashboardView
|
|
@@ -73,8 +81,13 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = (props) => {
|
|
|
73
81
|
ClientID={resolvedClientID}
|
|
74
82
|
ClientCode={resolvedClientCode}
|
|
75
83
|
user_token={resolvedToken}
|
|
84
|
+
isOrigin={isOrigin}
|
|
85
|
+
themeColor={themeColor}
|
|
76
86
|
headerTextColor={headerThemeColor ?? headerTextColor}
|
|
77
87
|
headerIconColor={headerThemeColor ?? headerIconColor}
|
|
88
|
+
accentColor={accentColor}
|
|
89
|
+
fontFamily={fontFamily}
|
|
90
|
+
payload={payload ?? null}
|
|
78
91
|
/>
|
|
79
92
|
);
|
|
80
93
|
};
|