@convep_mobilogy/react-native-qms-plugin 0.10.2 → 0.10.4
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 +1 -1
- package/lib/module/QmsPlugin.js +16 -0
- package/lib/module/QmsPlugin.js.map +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/QmsPlugin.d.ts +9 -0
- package/lib/typescript/src/QmsPlugin.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/QmsPlugin.ts +35 -0
- package/src/index.tsx +2 -0
package/android/build.gradle
CHANGED
|
@@ -75,7 +75,7 @@ dependencies {
|
|
|
75
75
|
implementation "com.facebook.react:react-android"
|
|
76
76
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
77
|
implementation 'com.facebook.react:react-native:+'
|
|
78
|
-
implementation "com.convep.qms:qms-plugin:1.12.
|
|
78
|
+
implementation "com.convep.qms:qms-plugin:1.12.17"
|
|
79
79
|
|
|
80
80
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
81
81
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { NativeModules } from 'react-native';
|
|
4
|
+
const {
|
|
5
|
+
QmsModule
|
|
6
|
+
} = NativeModules;
|
|
7
|
+
export const QmsPlugin = {
|
|
8
|
+
emitInAppNotification(payload) {
|
|
9
|
+
if (QmsModule?.emitInAppNotificationWithPayload) {
|
|
10
|
+
QmsModule.emitInAppNotificationWithPayload(payload.title ?? 'Notification', payload.body ?? '', payload.data ?? null);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
QmsModule?.emitInAppNotification?.(payload.title ?? 'Notification', payload.body ?? '');
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=QmsPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","QmsModule","QmsPlugin","emitInAppNotification","payload","emitInAppNotificationWithPayload","title","body","data"],"sourceRoot":"../../src","sources":["QmsPlugin.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,cAAc;AAQ5C,MAAM;EAAEC;AAAU,CAAC,GAAGD,aASrB;AAED,OAAO,MAAME,SAAS,GAAG;EACvBC,qBAAqBA,CAACC,OAAiC,EAAQ;IAC7D,IAAIH,SAAS,EAAEI,gCAAgC,EAAE;MAC/CJ,SAAS,CAACI,gCAAgC,CACxCD,OAAO,CAACE,KAAK,IAAI,cAAc,EAC/BF,OAAO,CAACG,IAAI,IAAI,EAAE,EAClBH,OAAO,CAACI,IAAI,IAAI,IAClB,CAAC;MACD;IACF;IACAP,SAAS,EAAEE,qBAAqB,GAC9BC,OAAO,CAACE,KAAK,IAAI,cAAc,EAC/BF,OAAO,CAACG,IAAI,IAAI,EAClB,CAAC;EACH;AACF,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["QmsDashboardView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,uBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["QmsDashboardView","QmsPlugin"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,uBAAoB;AAErD,SAASC,SAAS,QAAQ,gBAAa","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QmsPlugin.d.ts","sourceRoot":"","sources":["../../../src/QmsPlugin.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAaF,eAAO,MAAM,SAAS;mCACW,wBAAwB,GAAG,IAAI;CAc/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
package/src/QmsPlugin.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { NativeModules } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export type InAppNotificationPayload = {
|
|
4
|
+
title?: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
data?: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const { QmsModule } = NativeModules as {
|
|
10
|
+
QmsModule?: {
|
|
11
|
+
emitInAppNotification?: (title?: string, body?: string) => void;
|
|
12
|
+
emitInAppNotificationWithPayload?: (
|
|
13
|
+
title?: string,
|
|
14
|
+
body?: string,
|
|
15
|
+
data?: Record<string, unknown> | null
|
|
16
|
+
) => void;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const QmsPlugin = {
|
|
21
|
+
emitInAppNotification(payload: InAppNotificationPayload): void {
|
|
22
|
+
if (QmsModule?.emitInAppNotificationWithPayload) {
|
|
23
|
+
QmsModule.emitInAppNotificationWithPayload(
|
|
24
|
+
payload.title ?? 'Notification',
|
|
25
|
+
payload.body ?? '',
|
|
26
|
+
payload.data ?? null
|
|
27
|
+
);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
QmsModule?.emitInAppNotification?.(
|
|
31
|
+
payload.title ?? 'Notification',
|
|
32
|
+
payload.body ?? ''
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
};
|
package/src/index.tsx
CHANGED