From e125aec1930a9fc54771d293aaf9721b174b9978 Mon Sep 17 00:00:00 2001 From: staszekscp Date: Mon, 22 Jul 2024 09:51:44 +0200 Subject: [PATCH] fix plaid failure on ios --- ios/NewExpensify.xcodeproj/project.pbxproj | 36 +++++++++++++++---- .../react-native-plaid-link-sdk+11.11.0.patch | 35 ++++++++++++++++++ 2 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 patches/react-native-plaid-link-sdk+11.11.0.patch diff --git a/ios/NewExpensify.xcodeproj/project.pbxproj b/ios/NewExpensify.xcodeproj/project.pbxproj index 164f8485129b..3afc8d4e6cf0 100644 --- a/ios/NewExpensify.xcodeproj/project.pbxproj +++ b/ios/NewExpensify.xcodeproj/project.pbxproj @@ -1580,7 +1580,11 @@ "$(inherited)", "-DRN_FABRIC_ENABLED", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); PRODUCT_BUNDLE_IDENTIFIER = ""; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -1648,7 +1652,11 @@ "$(inherited)", "-DRN_FABRIC_ENABLED", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); PRODUCT_BUNDLE_IDENTIFIER = ""; PRODUCT_NAME = ""; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; @@ -1726,7 +1734,11 @@ "$(inherited)", "-DRN_FABRIC_ENABLED", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); PRODUCT_BUNDLE_IDENTIFIER = ""; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -1871,7 +1883,11 @@ "$(inherited)", "-DRN_FABRIC_ENABLED", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); PRODUCT_BUNDLE_IDENTIFIER = ""; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; @@ -2008,7 +2024,11 @@ "$(inherited)", "-DRN_FABRIC_ENABLED", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); PRODUCT_BUNDLE_IDENTIFIER = ""; PRODUCT_NAME = ""; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; @@ -2143,7 +2163,11 @@ "$(inherited)", "-DRN_FABRIC_ENABLED", ); - OTHER_LDFLAGS = "$(inherited)"; + OTHER_LDFLAGS = ( + "$(inherited)", + "-Wl", + "-ld_classic", + ); PRODUCT_BUNDLE_IDENTIFIER = ""; PRODUCT_NAME = ""; REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; diff --git a/patches/react-native-plaid-link-sdk+11.11.0.patch b/patches/react-native-plaid-link-sdk+11.11.0.patch new file mode 100644 index 000000000000..28e492f6999f --- /dev/null +++ b/patches/react-native-plaid-link-sdk+11.11.0.patch @@ -0,0 +1,35 @@ +diff --git a/node_modules/react-native-plaid-link-sdk/ios/PLKFabricHelpers.h b/node_modules/react-native-plaid-link-sdk/ios/PLKFabricHelpers.h +index cf70d5e..4e34cd2 100644 +--- a/node_modules/react-native-plaid-link-sdk/ios/PLKFabricHelpers.h ++++ b/node_modules/react-native-plaid-link-sdk/ios/PLKFabricHelpers.h +@@ -5,8 +5,12 @@ + #if __has_include() + #import + #else ++#ifdef USE_FRAMEWORKS ++#import ++#else + #import + #endif ++#endif + + // copied from RCTFollyConvert + folly::dynamic PLKConvertIdToFollyDynamic(id json) +diff --git a/node_modules/react-native-plaid-link-sdk/react-native-plaid-link-sdk.podspec b/node_modules/react-native-plaid-link-sdk/react-native-plaid-link-sdk.podspec +index 7c60081..4a13a3c 100644 +--- a/node_modules/react-native-plaid-link-sdk/react-native-plaid-link-sdk.podspec ++++ b/node_modules/react-native-plaid-link-sdk/react-native-plaid-link-sdk.podspec +@@ -21,6 +21,13 @@ Pod::Spec.new do |s| + # we don't want this to be seen by Swift + s.private_header_files = 'ios/PLKFabricHelpers.h' + ++ if ENV['USE_FRAMEWORKS'] == '1' ++ s.pod_target_xcconfig = { ++ "OTHER_CFLAGS" => "$(inherited) -DUSE_FRAMEWORKS", ++ "OTHER_CPLUSPLUSFLAGS" => "$(inherited) -DUSE_FRAMEWORKS", ++ } ++ end ++ + if fabric_enabled + install_modules_dependencies(s) + else