Closed azmanjamlie closed 2 years ago
For the time being, you can apply this patch with patch-package as a workaround.
molpay-mobile-xdk-reactnative-beta+0.29.0.patch
diff --git a/node_modules/molpay-mobile-xdk-reactnative-beta/ios/MOLPayReactManager.m b/node_modules/molpay-mobile-xdk-reactnative-beta/ios/MOLPayReactManager.m
index 18ec8f0..3f9fe94 100644
--- a/node_modules/molpay-mobile-xdk-reactnative-beta/ios/MOLPayReactManager.m
+++ b/node_modules/molpay-mobile-xdk-reactnative-beta/ios/MOLPayReactManager.m
@@ -28,22 +28,22 @@ @implementation MOLPayReactManager
RCT_EXPORT_METHOD(setPaymentDetails:(NSDictionary *)paymentDetails callback:(RCTResponseSenderBlock)callback)
{
- MOLPayReactViewController *mpvc = [[MOLPayReactViewController alloc] init];
- NSMutableDictionary *paymentDetailsMutable = [paymentDetails mutableCopy];
-
- [mpvc.view setBackgroundColor:[UIColor whiteColor]];
- [paymentDetailsMutable setObject:@"YES" forKey:@"is_submodule"];
- [paymentDetailsMutable setObject:@"molpay-mobile-xdk-reactnative-beta-ios" forKey:@"module_id"];
- [paymentDetailsMutable setObject:@"0" forKey:@"wrapper_version"];
- mpvc.PaymentDetails = paymentDetailsMutable;
- UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:mpvc];
- mpvc.didDismiss = ^(NSDictionary *data) {
- [[[[UIApplication sharedApplication] windows] firstObject] makeKeyAndVisible];
- callback(@[data]);
- };
- dispatch_sync(dispatch_get_main_queue(), ^{
- [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:nc animated:YES completion:nil];
- });
+ dispatch_sync(dispatch_get_main_queue(), ^{
+ MOLPayReactViewController *mpvc = [[MOLPayReactViewController alloc] init];
+ NSMutableDictionary *paymentDetailsMutable = [paymentDetails mutableCopy];
+
+ [mpvc.view setBackgroundColor:[UIColor whiteColor]];
+ [paymentDetailsMutable setObject:@"YES" forKey:@"is_submodule"];
+ [paymentDetailsMutable setObject:@"molpay-mobile-xdk-reactnative-beta-ios" forKey:@"module_id"];
+ [paymentDetailsMutable setObject:@"0" forKey:@"wrapper_version"];
+ mpvc.PaymentDetails = paymentDetailsMutable;
+ UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:mpvc];
+ mpvc.didDismiss = ^(NSDictionary *data) {
+ [[[[UIApplication sharedApplication] windows] firstObject] makeKeyAndVisible];
+ callback(@[data]);
+ };
+ [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:nc animated:YES completion:nil];
+ });
}
It seems like this has already been patched in v0.32.0
.
I really hope that they can improve the developer experience, there's no changelog for every new release, I do have to tap in the source code and check what is the changes.
At least open source the RN-related code.
thanks, its fixed.
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.' terminating with uncaught exception of type NSException