@convep_mobilogy/react-native-qms-plugin 0.9.1 → 0.9.3
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/ios/QmsPlugin/QmsDashboardViewManager.mm +54 -18
- package/ios/QmsPlugin/QmsPluginBridge.mm +1 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/Assets.car +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/QmsPluginFramework +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/_CodeSignature/CodeResources +2 -2
- 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/QmsPluginFramework +0 -0
- package/ios/QmsPluginFramework.xcframework/ios-arm64_x86_64-simulator/QmsPluginFramework.framework/_CodeSignature/CodeResources +2 -2
- package/package.json +1 -1
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.
|
|
78
|
+
implementation "com.convep.qms:qms-plugin:1.10.0"
|
|
79
79
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
|
80
80
|
|
|
81
81
|
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
|
|
@@ -6,43 +6,75 @@
|
|
|
6
6
|
@interface QmsDashboardView : UIView
|
|
7
7
|
@property (nonatomic, strong) UIViewController *dashboardVC;
|
|
8
8
|
@property (nonatomic, assign) BOOL didSetupVC;
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
@property (nonatomic, copy) NSString *ClientID;
|
|
11
11
|
@property (nonatomic, copy) NSString *ClientCode;
|
|
12
12
|
@property (nonatomic, copy) NSString *user_token;
|
|
13
|
+
|
|
14
|
+
@property (nonatomic, copy) RCTDirectEventBlock onClose;
|
|
13
15
|
@end
|
|
14
16
|
|
|
15
17
|
@implementation QmsDashboardView
|
|
16
18
|
|
|
17
19
|
- (instancetype)initWithFrame:(CGRect)frame {
|
|
18
20
|
if (self = [super initWithFrame:frame]) {
|
|
19
|
-
_dashboardVC = [QmsPluginUI makeViewController];
|
|
21
|
+
_dashboardVC = [QmsPluginUI makeViewController];
|
|
20
22
|
_didSetupVC = NO;
|
|
21
23
|
_dashboardVC.view.backgroundColor = [UIColor whiteColor];
|
|
24
|
+
|
|
25
|
+
// Listen for native dashboard close notification
|
|
26
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
27
|
+
selector:@selector(handleDashboardClose:)
|
|
28
|
+
name:@"QmsDashboardDidCloseNotification"
|
|
29
|
+
object:nil];
|
|
22
30
|
}
|
|
23
31
|
return self;
|
|
24
32
|
}
|
|
25
33
|
|
|
26
34
|
- (void)didMoveToWindow {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
[super didMoveToWindow];
|
|
36
|
+
if (self.window && !_didSetupVC) {
|
|
37
|
+
UIViewController *parentVC = [UIApplication sharedApplication].keyWindow.rootViewController;
|
|
38
|
+
if (parentVC) {
|
|
39
|
+
|
|
40
|
+
// 1️⃣ create VC with props
|
|
41
|
+
_dashboardVC = [QmsPluginUI makeViewController];
|
|
42
|
+
|
|
43
|
+
[parentVC addChildViewController:_dashboardVC];
|
|
44
|
+
_dashboardVC.view.frame = parentVC.view.bounds;
|
|
45
|
+
_dashboardVC.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
46
|
+
[parentVC.view addSubview:_dashboardVC.view];
|
|
47
|
+
[_dashboardVC didMoveToParentViewController:parentVC];
|
|
48
|
+
_didSetupVC = YES;
|
|
49
|
+
|
|
50
|
+
// 2️⃣ forward props again if needed
|
|
51
|
+
[self forwardPropsToVC];
|
|
52
|
+
}
|
|
40
53
|
}
|
|
41
|
-
}
|
|
42
54
|
}
|
|
43
55
|
|
|
44
|
-
|
|
56
|
+
- (void)handleDashboardClose:(NSNotification *)note {
|
|
57
|
+
// 1️⃣ Notify JS
|
|
58
|
+
if (self.onClose) {
|
|
59
|
+
self.onClose(@{});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 2️⃣ Clean up the native view controller
|
|
63
|
+
[self cleanupDashboard];
|
|
64
|
+
}
|
|
45
65
|
|
|
66
|
+
- (void)cleanupDashboard {
|
|
67
|
+
if (!_dashboardVC) return;
|
|
68
|
+
|
|
69
|
+
[_dashboardVC willMoveToParentViewController:nil];
|
|
70
|
+
[_dashboardVC.view removeFromSuperview];
|
|
71
|
+
[_dashboardVC removeFromParentViewController];
|
|
72
|
+
|
|
73
|
+
_dashboardVC = nil;
|
|
74
|
+
_didSetupVC = NO;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
#pragma mark - Prop Setters
|
|
46
78
|
- (void)setClientID:(NSString *)ClientID {
|
|
47
79
|
_ClientID = [ClientID copy];
|
|
48
80
|
[self forwardProp:@"ClientID" value:_ClientID];
|
|
@@ -59,7 +91,6 @@
|
|
|
59
91
|
}
|
|
60
92
|
|
|
61
93
|
#pragma mark - Forward Props via KVC
|
|
62
|
-
|
|
63
94
|
- (void)forwardProp:(NSString *)key value:(NSString *)value {
|
|
64
95
|
if (_dashboardVC && [_dashboardVC respondsToSelector:NSSelectorFromString(key)]) {
|
|
65
96
|
@try {
|
|
@@ -76,6 +107,11 @@
|
|
|
76
107
|
[self forwardProp:@"user_token" value:_user_token];
|
|
77
108
|
}
|
|
78
109
|
|
|
110
|
+
- (void)removeFromSuperview {
|
|
111
|
+
[self cleanupDashboard];
|
|
112
|
+
[super removeFromSuperview];
|
|
113
|
+
}
|
|
114
|
+
|
|
79
115
|
@end
|
|
80
116
|
|
|
81
117
|
@interface QmsDashboardViewManager : RCTViewManager
|
package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/Assets.car
CHANGED
|
Binary file
|
package/ios/QmsPluginFramework.xcframework/ios-arm64/QmsPluginFramework.framework/QmsPluginFramework
CHANGED
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<dict>
|
|
7
7
|
<key>Assets.car</key>
|
|
8
8
|
<data>
|
|
9
|
-
|
|
9
|
+
apewM0kg8bkb0nA0BqxaEqt0L8I=
|
|
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
|
-
|
|
34
|
+
kujF94lp6x0Gv/ur/rYZEuwSRGB/AosKCC73EYwiL8g=
|
|
35
35
|
</data>
|
|
36
36
|
</dict>
|
|
37
37
|
<key>Headers/QmsPlugin.h</key>
|
|
Binary file
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<dict>
|
|
7
7
|
<key>Assets.car</key>
|
|
8
8
|
<data>
|
|
9
|
-
|
|
9
|
+
apewM0kg8bkb0nA0BqxaEqt0L8I=
|
|
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
|
-
|
|
34
|
+
kujF94lp6x0Gv/ur/rYZEuwSRGB/AosKCC73EYwiL8g=
|
|
35
35
|
</data>
|
|
36
36
|
</dict>
|
|
37
37
|
<key>Headers/QmsPlugin.h</key>
|