@convep_mobilogy/react-native-qms-plugin 1.8.2 → 1.8.13

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.
@@ -21,6 +21,16 @@ apply plugin: "kotlin-android"
21
21
 
22
22
  apply plugin: "com.facebook.react"
23
23
 
24
+ def qmsLocalMavenRepo = uri("$projectDir/maven-repo")
25
+
26
+ // Make the bundled native framework available to the consuming app. This lets
27
+ // local TGZ installs use the matching AAR without waiting for remote publishing.
28
+ rootProject.allprojects {
29
+ repositories {
30
+ maven { url = qmsLocalMavenRepo }
31
+ }
32
+ }
33
+
24
34
  def getExtOrIntegerDefault(name) {
25
35
  return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["QmsPlugin_" + name]).toInteger()
26
36
  }
@@ -75,8 +85,7 @@ dependencies {
75
85
  implementation "com.facebook.react:react-android"
76
86
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77
87
  implementation 'com.facebook.react:react-native:+'
78
- implementation "com.convep.qms:qms-plugin:1.25.2"
79
-
88
+ implementation "com.convep.qms:qms-plugin:1.26.2"
80
89
  implementation 'androidx.appcompat:appcompat:1.6.1'
81
90
 
82
91
  implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
@@ -72,9 +72,12 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
72
72
 
73
73
  - (instancetype)initWithFrame:(CGRect)frame {
74
74
  if (self = [super initWithFrame:frame]) {
75
- _dashboardVC = [QmsPluginUI makeViewController];
75
+ // The controller must only be created after this native view is mounted.
76
+ // Creating it here lets credential props start the API flow before React
77
+ // has forwarded isOrigin, leaving a detached controller making requests.
78
+ _dashboardVC = nil;
76
79
  _didSetupVC = NO;
77
- _dashboardVC.view.backgroundColor = [UIColor whiteColor];
80
+ _isOrigin = NO;
78
81
 
79
82
  // Listen for native dashboard close notification
80
83
  [[NSNotificationCenter defaultCenter] addObserver:self
@@ -114,6 +117,7 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
114
117
 
115
118
  // 1️⃣ create VC with props
116
119
  _dashboardVC = [QmsPluginUI makeViewController];
120
+ _dashboardVC.view.backgroundColor = [UIColor whiteColor];
117
121
 
118
122
  [parentVC addChildViewController:_dashboardVC];
119
123
  _dashboardVC.view.frame = parentVC.view.bounds;
@@ -177,8 +181,13 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
177
181
  }
178
182
 
179
183
  - (void)cleanupDashboard {
184
+ // APIConfig is process-global inside the framework. Reset it before
185
+ // teardown so a later embedded dashboard cannot inherit origin mode.
186
+ _isOrigin = NO;
180
187
  if (!_dashboardVC) return;
181
188
 
189
+ [self forwardProp:@"isOrigin" value:@NO];
190
+
182
191
  [_dashboardVC willMoveToParentViewController:nil];
183
192
  [_dashboardVC.view removeFromSuperview];
184
193
  [_dashboardVC removeFromParentViewController];
@@ -268,6 +277,9 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
268
277
  }
269
278
 
270
279
  - (void)forwardPropsToVC {
280
+ // Apply mode before credentials. The token setter can make the project
281
+ // controller ready and start its API chain immediately.
282
+ [self forwardProp:@"isOrigin" value:@(_isOrigin)];
271
283
  [self forwardProp:@"ClientID" value:_ClientID];
272
284
  [self forwardProp:@"ClientCode" value:_ClientCode];
273
285
  [self forwardProp:@"user_token" value:_user_token];
@@ -277,7 +289,6 @@ static NSString * const kQmsRoutePayloadNotification = @"QmsRoutePayloadNotifica
277
289
  [self forwardProp:@"headerIconColor" value:_headerIconColor];
278
290
  [self forwardProp:@"accentColor" value:_accentColor];
279
291
  [self forwardProp:@"fontFamily" value:_fontFamily];
280
- [self forwardProp:@"isOrigin" value:@(_isOrigin)];
281
292
  [self forwardProp:@"versionNumber" value:_versionNumber];
282
293
  [self applyAllThemeImmediatelyIfNeeded];
283
294
  }
@@ -64,10 +64,12 @@ RCT_EXPORT_MODULE(QmsModule)
64
64
  isOrigin:(BOOL)isOrigin {
65
65
  if (!vc) return;
66
66
  @try {
67
+ // isOrigin must be applied before the token. Setting the token can make
68
+ // ProjectViewController start loading immediately.
69
+ [vc setValue:@(isOrigin) forKey:@"isOrigin"];
67
70
  [vc setValue:(clientID ?: @"") forKey:@"ClientID"];
68
71
  [vc setValue:(clientCode ?: @"") forKey:@"ClientCode"];
69
72
  [vc setValue:(userToken ?: @"") forKey:@"user_token"];
70
- [vc setValue:@(isOrigin) forKey:@"isOrigin"];
71
73
  } @catch (__unused NSException *exception) {}
72
74
  }
73
75
 
@@ -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>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@convep_mobilogy/react-native-qms-plugin",
3
- "version": "1.8.2",
3
+ "version": "1.8.13",
4
4
  "description": "To handle defect managment",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",