@convep_mobilogy/react-native-qms-plugin 0.9.0 → 0.9.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/QmsPlugin.podspec CHANGED
@@ -6,7 +6,12 @@ Pod::Spec.new do |s|
6
6
  s.name = "QmsPlugin"
7
7
  s.version = package["version"]
8
8
  s.summary = package["description"]
9
- s.homepage = package["homepage"]
9
+ homepage = package["homepage"]
10
+ if homepage.nil? || homepage.empty?
11
+ repo_url = package.dig("repository", "url")
12
+ homepage = repo_url ? repo_url.sub(/\Agit\+/, "") : "https://example.com"
13
+ end
14
+ s.homepage = homepage
10
15
  s.license = package["license"]
11
16
  s.authors = package["author"]
12
17
  s.platforms = { :ios => "12.4" }
@@ -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.9.5"
78
+ implementation "com.convep.qms:qms-plugin:1.9.8"
79
79
  implementation 'androidx.appcompat:appcompat:1.6.1'
80
80
 
81
81
  implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
@@ -95,3 +95,48 @@ RCT_EXPORT_VIEW_PROPERTY(ClientCode, NSString)
95
95
  RCT_EXPORT_VIEW_PROPERTY(user_token, NSString)
96
96
 
97
97
  @end
98
+
99
+ #import <React/RCTEventEmitter.h>
100
+ #import <React/RCTBridgeModule.h>
101
+
102
+ @interface QmsDashboardEmitter : RCTEventEmitter <RCTBridgeModule>
103
+ @end
104
+
105
+ @implementation QmsDashboardEmitter
106
+
107
+ RCT_EXPORT_MODULE();
108
+
109
+ + (id)allocWithZone:(NSZone *)zone {
110
+ static QmsDashboardEmitter *sharedInstance = nil;
111
+ static dispatch_once_t onceToken;
112
+ dispatch_once(&onceToken, ^{
113
+ sharedInstance = [super allocWithZone:zone];
114
+ });
115
+ return sharedInstance;
116
+ }
117
+
118
+ - (instancetype)init {
119
+ if (self = [super init]) {
120
+ // Listen for the framework notification
121
+ [[NSNotificationCenter defaultCenter] addObserver:self
122
+ selector:@selector(handleDashboardClose:)
123
+ name:@"QmsDashboardDidCloseNotification"
124
+ object:nil];
125
+ }
126
+ return self;
127
+ }
128
+
129
+ - (NSArray<NSString *> *)supportedEvents {
130
+ return @[@"onClose"];
131
+ }
132
+
133
+ - (void)handleDashboardClose:(NSNotification *)note {
134
+ // Send event to JS
135
+ [self sendEventWithName:@"onClose" body:note.userInfo];
136
+ }
137
+
138
+ - (void)dealloc {
139
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
140
+ }
141
+
142
+ @end
@@ -69,7 +69,6 @@ RCT_EXPORT_MODULE()
69
69
  });
70
70
  }
71
71
 
72
-
73
72
  // TurboModule boilerplate
74
73
  - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
75
74
  (const facebook::react::ObjCTurboModule::InitParams &)params
@@ -8,32 +8,32 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>QmsPluginFramework.framework/QmsPluginFramework</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64</string>
11
+ <string>ios-arm64_x86_64-simulator</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>QmsPluginFramework.framework</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
+ <string>x86_64</string>
17
18
  </array>
18
19
  <key>SupportedPlatform</key>
19
20
  <string>ios</string>
21
+ <key>SupportedPlatformVariant</key>
22
+ <string>simulator</string>
20
23
  </dict>
21
24
  <dict>
22
25
  <key>BinaryPath</key>
23
26
  <string>QmsPluginFramework.framework/QmsPluginFramework</string>
24
27
  <key>LibraryIdentifier</key>
25
- <string>ios-arm64_x86_64-simulator</string>
28
+ <string>ios-arm64</string>
26
29
  <key>LibraryPath</key>
27
30
  <string>QmsPluginFramework.framework</string>
28
31
  <key>SupportedArchitectures</key>
29
32
  <array>
30
33
  <string>arm64</string>
31
- <string>x86_64</string>
32
34
  </array>
33
35
  <key>SupportedPlatform</key>
34
36
  <string>ios</string>
35
- <key>SupportedPlatformVariant</key>
36
- <string>simulator</string>
37
37
  </dict>
38
38
  </array>
39
39
  <key>CFBundlePackageType</key>
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Assets.car</key>
8
8
  <data>
9
- 4/wVNoFd+WcEg7nmH9Hm5v1nm7s=
9
+ tiDJHgS+Mbu43+C6GiuoJR1rE/s=
10
10
  </data>
11
11
  <key>Headers/QmsPlugin.h</key>
12
12
  <data>
@@ -31,7 +31,7 @@
31
31
  <dict>
32
32
  <key>hash2</key>
33
33
  <data>
34
- zhv68b8E95A9988/pvXA0JKzn5/KsdixWe45ATxfW3g=
34
+ NzmSax3a+FRy3d2BvvftoEyaWVf17BzGCiO9/CkeCM8=
35
35
  </data>
36
36
  </dict>
37
37
  <key>Headers/QmsPlugin.h</key>
@@ -6,7 +6,7 @@
6
6
  <dict>
7
7
  <key>Assets.car</key>
8
8
  <data>
9
- 4/wVNoFd+WcEg7nmH9Hm5v1nm7s=
9
+ tiDJHgS+Mbu43+C6GiuoJR1rE/s=
10
10
  </data>
11
11
  <key>Headers/QmsPlugin.h</key>
12
12
  <data>
@@ -31,7 +31,7 @@
31
31
  <dict>
32
32
  <key>hash2</key>
33
33
  <data>
34
- zhv68b8E95A9988/pvXA0JKzn5/KsdixWe45ATxfW3g=
34
+ NzmSax3a+FRy3d2BvvftoEyaWVf17BzGCiO9/CkeCM8=
35
35
  </data>
36
36
  </dict>
37
37
  <key>Headers/QmsPlugin.h</key>
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
 
3
- import React from 'react';
4
- import { requireNativeComponent } from 'react-native';
3
+ import React, { useEffect } from 'react';
4
+ import { 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
+ onClose,
10
11
  clientID,
11
12
  clientCode,
12
13
  ClientID,
@@ -20,6 +21,14 @@ export const QmsDashboardView = props => {
20
21
  const resolvedClientID = clientID ?? ClientID ?? '';
21
22
  const resolvedClientCode = clientCode ?? ClientCode ?? '';
22
23
  const resolvedToken = user_token ?? token ?? userToken ?? '';
24
+ useEffect(() => {
25
+ if (!onClose) return;
26
+ const nativeEmitterModule = NativeModules.QmsDashboardEmitter;
27
+ if (!nativeEmitterModule) return;
28
+ const emitter = new NativeEventEmitter(nativeEmitterModule);
29
+ const subscription = emitter.addListener('onClose', onClose);
30
+ return () => subscription.remove();
31
+ }, [onClose]);
23
32
  return /*#__PURE__*/_jsx(NativeQmsDashboardView, {
24
33
  ...rest,
25
34
  ClientID: resolvedClientID,
@@ -1 +1 @@
1
- {"version":3,"names":["React","requireNativeComponent","jsx","_jsx","NativeQmsDashboardView","QmsDashboardView","props","clientID","clientCode","ClientID","ClientCode","user_token","userToken","token","rest","resolvedClientID","resolvedClientCode","resolvedToken"],"sourceRoot":"../../src","sources":["QmsDashboardView.ios.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,sBAAsB,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGtD;AACA,MAAMC,sBAAsB,GAC1BH,sBAAsB,CAAwB,kBAAkB,CAAC;AAEnE,OAAO,MAAMI,gBAAiD,GAAIC,KAAK,IAAK;EAC1E,MAAM;IACJC,QAAQ;IACRC,UAAU;IACVC,QAAQ;IACRC,UAAU;IACVC,UAAU;IACVC,SAAS;IACTC,KAAK;IACL;IACA,GAAGC;EACL,CAAC,GAAGR,KAAK;EAET,MAAMS,gBAAgB,GAAGR,QAAQ,IAAIE,QAAQ,IAAI,EAAE;EACnD,MAAMO,kBAAkB,GAAGR,UAAU,IAAIE,UAAU,IAAI,EAAE;EACzD,MAAMO,aAAa,GAAGN,UAAU,IAAIE,KAAK,IAAID,SAAS,IAAI,EAAE;EAE5D,oBACET,IAAA,CAACC,sBAAsB;IAAA,GACjBU,IAAI;IACRL,QAAQ,EAAEM,gBAAiB;IAC3BL,UAAU,EAAEM,kBAAmB;IAC/BL,UAAU,EAAEM;EAAc,CAC3B,CAAC;AAEN,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","NativeEventEmitter","NativeModules","requireNativeComponent","jsx","_jsx","NativeQmsDashboardView","QmsDashboardView","props","onClose","clientID","clientCode","ClientID","ClientCode","user_token","userToken","token","rest","resolvedClientID","resolvedClientCode","resolvedToken","nativeEmitterModule","QmsDashboardEmitter","emitter","subscription","addListener","remove"],"sourceRoot":"../../src","sources":["QmsDashboardView.ios.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACEC,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,UAAU;IACVC,QAAQ;IACRC,UAAU;IACVC,UAAU;IACVC,SAAS;IACTC,KAAK;IACL;IACA,GAAGC;EACL,CAAC,GAAGT,KAAK;EAET,MAAMU,gBAAgB,GAAGR,QAAQ,IAAIE,QAAQ,IAAI,EAAE;EACnD,MAAMO,kBAAkB,GAAGR,UAAU,IAAIE,UAAU,IAAI,EAAE;EACzD,MAAMO,aAAa,GAAGN,UAAU,IAAIE,KAAK,IAAID,SAAS,IAAI,EAAE;EAE5Df,SAAS,CAAC,MAAM;IACd,IAAI,CAACS,OAAO,EAAE;IACd,MAAMY,mBAAmB,GAAGnB,aAAa,CAACoB,mBAAmB;IAC7D,IAAI,CAACD,mBAAmB,EAAE;IAC1B,MAAME,OAAO,GAAG,IAAItB,kBAAkB,CAACoB,mBAAmB,CAAC;IAC3D,MAAMG,YAAY,GAAGD,OAAO,CAACE,WAAW,CAAC,SAAS,EAAEhB,OAAO,CAAC;IAC5D,OAAO,MAAMe,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC,CAAC,EAAE,CAACjB,OAAO,CAAC,CAAC;EAEb,oBACEJ,IAAA,CAACC,sBAAsB;IAAA,GACjBW,IAAI;IACRL,QAAQ,EAAEM,gBAAiB;IAC3BL,UAAU,EAAEM,kBAAmB;IAC/BL,UAAU,EAAEM;EAAc,CAC3B,CAAC;AAEN,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"QmsDashboardView.ios.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAMtE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAyB5D,CAAC"}
1
+ {"version":3,"file":"QmsDashboardView.ios.d.ts","sourceRoot":"","sources":["../../../src/QmsDashboardView.ios.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAMzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAMtE,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAmC5D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convep_mobilogy/react-native-qms-plugin",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "To handle defect managment",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -1,5 +1,9 @@
1
- import React from 'react';
2
- import { requireNativeComponent } from 'react-native';
1
+ import React, { useEffect } from 'react';
2
+ import {
3
+ NativeEventEmitter,
4
+ NativeModules,
5
+ requireNativeComponent,
6
+ } from 'react-native';
3
7
  import type { QmsDashboardViewProps } from './QmsDashboardView.types';
4
8
 
5
9
  // Make sure your iOS native view manager is exported as "QmsDashboardView"
@@ -8,6 +12,7 @@ const NativeQmsDashboardView =
8
12
 
9
13
  export const QmsDashboardView: React.FC<QmsDashboardViewProps> = (props) => {
10
14
  const {
15
+ onClose,
11
16
  clientID,
12
17
  clientCode,
13
18
  ClientID,
@@ -23,6 +28,15 @@ export const QmsDashboardView: React.FC<QmsDashboardViewProps> = (props) => {
23
28
  const resolvedClientCode = clientCode ?? ClientCode ?? '';
24
29
  const resolvedToken = user_token ?? token ?? userToken ?? '';
25
30
 
31
+ useEffect(() => {
32
+ if (!onClose) return;
33
+ const nativeEmitterModule = NativeModules.QmsDashboardEmitter;
34
+ if (!nativeEmitterModule) return;
35
+ const emitter = new NativeEventEmitter(nativeEmitterModule);
36
+ const subscription = emitter.addListener('onClose', onClose);
37
+ return () => subscription.remove();
38
+ }, [onClose]);
39
+
26
40
  return (
27
41
  <NativeQmsDashboardView
28
42
  {...rest}