From 80d4fefeec012863f2ef012c022af3a563fb1850 Mon Sep 17 00:00:00 2001 From: alejandro-all-win-software Date: Fri, 20 Dec 2024 13:44:45 -0600 Subject: [PATCH] chore: fixed issues with cocoapods --- example/ios/Runner.xcodeproj/project.pbxproj | 20 +++++++++++++++++++ .../xcshareddata/swiftpm/Package.resolved | 15 ++++++++++++++ .../xcshareddata/xcschemes/Runner.xcscheme | 18 +++++++++++++++++ .../xcshareddata/swiftpm/Package.resolved | 15 ++++++++++++++ example/macos/Podfile.lock | 2 +- example/macos/Runner/AppDelegate.swift | 6 +++++- packages/stripe_ios/ios/stripe_ios.podspec | 14 ++++++++++--- .../stripe_ios/ApplePayButtonView.swift | 2 ++ .../AddressSheet/AddressSheetView.swift | 2 ++ .../Stripe Sdk/AuBECSDebitFormView.swift | 2 ++ .../stripe_ios/Stripe Sdk/CardFieldView.swift | 2 ++ .../stripe_ios/Stripe Sdk/CardFormView.swift | 2 ++ .../Stripe Sdk/FinancialConnections.swift | 4 +++- .../Stripe Sdk/StripeSdk+CustomerSheet.swift | 2 ++ .../Stripe Sdk/StripeSdk+PaymentSheet.swift | 3 ++- .../stripe_ios/Stripe Sdk/StripeSdk.swift | 2 ++ .../AddToWalletButtonView.swift | 2 ++ .../Sources/stripe_ios/StripePlugin.swift | 3 ++- .../Sources/stripe_objc/RCTBridge.m | 4 ++++ .../include/stripe_objc-umbrella.h | 4 ++++ 20 files changed, 116 insertions(+), 8 deletions(-) create mode 100644 example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 7c88c655b..db7432bec 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -16,6 +16,7 @@ 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; C1C00DE1D4D140D43FF1F838 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0319CE3D006F4355FEBFB2E6 /* Pods_Runner.framework */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -81,6 +82,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, C1C00DE1D4D140D43FF1F838 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -189,6 +191,9 @@ productType = "com.apple.product-type.bundle.unit-test"; }; 97C146ED1CF9000F007C117D /* Runner */ = { + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( @@ -214,6 +219,9 @@ /* Begin PBXProject section */ 97C146E61CF9000F007C117D /* Project object */ = { + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); isa = PBXProject; attributes = { LastUpgradeCheck = 1510; @@ -775,6 +783,18 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 000000000..eba3a879d --- /dev/null +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,15 @@ +{ + "originHash" : "d75e1870e24786a8f3168abef93b2bf5b3c10211210817b12d64ec80e264c360", + "pins" : [ + { + "identity" : "stripe-ios-spm", + "kind" : "remoteSourceControl", + "location" : "https://github.com/stripe/stripe-ios-spm", + "state" : { + "revision" : "653fc8cfc40b33740401f9bd9faa8588f9a53e5f", + "version" : "23.32.0" + } + } + ], + "version" : 3 +} diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index d11d0fa28..2299ebe5f 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -5,6 +5,24 @@ + + + + + + + + + + Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/packages/stripe_ios/ios/stripe_ios.podspec b/packages/stripe_ios/ios/stripe_ios.podspec index afaaf356f..da2315ada 100644 --- a/packages/stripe_ios/ios/stripe_ios.podspec +++ b/packages/stripe_ios/ios/stripe_ios.podspec @@ -14,9 +14,6 @@ A new flutter plugin project. s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } - s.source_files = 'stripe_ios/Sources/**/*.' - s.public_header_files = 'stripe_ios/Sources/stripe_objc/include/**/*.h' - s.module_map = 'stripe_ios/Sources/stripe_objc/include/stripe_objc.modulemap' s.dependency 'Flutter' s.dependency 'Stripe', stripe_version s.dependency 'StripePaymentSheet', stripe_version @@ -24,6 +21,17 @@ A new flutter plugin project. s.dependency 'StripePaymentsUI', stripe_version s.dependency 'StripeApplePay', stripe_version s.dependency 'StripeFinancialConnections', stripe_version + + s.subspec 'stripe_objc' do |ss| + ss.source_files = 'stripe_ios/Sources/**/*.{m,h}' + ss.public_header_files = 'stripe_ios/Sources/stripe_objc/include/**/*.h' + end + + s.subspec 'stripe_ios' do |ss| + ss.source_files = 'stripe_ios/Sources/**/*.{swift}' + ss.dependency 'stripe_ios/stripe_objc' + end + s.platform = :ios, '13.0' # Flutter.framework does not contain a i386 slice. diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/ApplePayButtonView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/ApplePayButtonView.swift index 709e53e04..9732d4233 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/ApplePayButtonView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/ApplePayButtonView.swift @@ -8,7 +8,9 @@ import Flutter import UIKit import PassKit +#if canImport(stripe_objc) import stripe_objc +#endif class ApplePayButtonViewFactory: NSObject, FlutterPlatformViewFactory { private var messenger: FlutterBinaryMessenger diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetView.swift index b0db9845f..2a21a63c2 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AddressSheet/AddressSheetView.swift @@ -8,7 +8,9 @@ import Foundation import StripePaymentSheet import UIKit +#if canImport(stripe_objc) import stripe_objc +#endif @objc(AddressSheetView) class AddressSheetView: UIView { diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AuBECSDebitFormView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AuBECSDebitFormView.swift index 5487646bd..62e83c78f 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AuBECSDebitFormView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/AuBECSDebitFormView.swift @@ -1,7 +1,9 @@ import Foundation import UIKit import Stripe +#if canImport(stripe_objc) import stripe_objc +#endif @objc(AuBECSDebitFormView) class AuBECSDebitFormView: UIView, STPAUBECSDebitFormViewDelegate { diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFieldView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFieldView.swift index eaaa397fd..7105394c9 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFieldView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFieldView.swift @@ -1,7 +1,9 @@ import Foundation import UIKit import Stripe +#if canImport(stripe_objc) import stripe_objc +#endif class CardFieldView: UIView, STPPaymentCardTextFieldDelegate { @objc var onCardChange: RCTDirectEventBlock? diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFormView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFormView.swift index e8c8fa853..8dda09ddd 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFormView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/CardFormView.swift @@ -1,7 +1,9 @@ import Foundation import UIKit import Stripe +#if canImport(stripe_objc) import stripe_objc +#endif class CardFormView: UIView, STPCardFormViewDelegate { public var cardForm: STPCardFormView? diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/FinancialConnections.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/FinancialConnections.swift index 206cf44f6..4f7e934b9 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/FinancialConnections.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/FinancialConnections.swift @@ -8,8 +8,10 @@ import Foundation import StripeFinancialConnections import Stripe -import stripe_objc import UIKit +#if canImport(stripe_objc) +import stripe_objc +#endif class FinancialConnections { diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+CustomerSheet.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+CustomerSheet.swift index cf276628e..76993384a 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+CustomerSheet.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+CustomerSheet.swift @@ -8,7 +8,9 @@ import Foundation @_spi(PrivateBetaCustomerSheet) @_spi(STP) import StripePaymentSheet import UIKit +#if canImport(stripe_objc) import stripe_objc +#endif extension StripeSdk { @objc(initCustomerSheet:customerAdapterOverrides:resolver:rejecter:) diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+PaymentSheet.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+PaymentSheet.swift index 1e7c4733a..b87001dc4 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+PaymentSheet.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk+PaymentSheet.swift @@ -6,7 +6,9 @@ // import Foundation +#if canImport(stripe_objc) import stripe_objc +#endif @_spi(ExperimentalAllowsRemovalOfLastSavedPaymentMethodAPI) @_spi(CustomerSessionBetaAccess) @_spi(STP) import StripePaymentSheet extension StripeSdk { @@ -311,4 +313,3 @@ extension StripeSdk { } } } - diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk.swift index 72a4fdcac..84beb7a38 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/StripeSdk.swift @@ -3,7 +3,9 @@ import Stripe import StripePaymentSheet import StripeFinancialConnections import Foundation +#if canImport(stripe_objc) import stripe_objc +#endif @objc(StripeSdk) class StripeSdk: RCTEventEmitter, STPBankSelectionViewControllerDelegate, UIAdaptivePresentationControllerDelegate { diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/pushprovisioning/AddToWalletButtonView.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/pushprovisioning/AddToWalletButtonView.swift index 9d7cd42a5..0e4522685 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/pushprovisioning/AddToWalletButtonView.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/Stripe Sdk/pushprovisioning/AddToWalletButtonView.swift @@ -8,7 +8,9 @@ import Foundation import Stripe import PassKit +#if canImport(stripe_objc) import stripe_objc +#endif @objc(AddToWalletButtonView) class AddToWalletButtonView: UIView { diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/StripePlugin.swift b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/StripePlugin.swift index c9c37d620..e5edc83a2 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/StripePlugin.swift +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_ios/StripePlugin.swift @@ -2,7 +2,9 @@ import Flutter import UIKit import Stripe import PassKit +#if canImport(stripe_objc) import stripe_objc +#endif protocol ViewManagerDelegate { var cardFieldView: CardFieldView? { get set } @@ -660,4 +662,3 @@ extension StripePlugin { result(nil) } } - diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/RCTBridge.m b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/RCTBridge.m index 70bde302e..ff3ecc0bc 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/RCTBridge.m +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/RCTBridge.m @@ -1,4 +1,8 @@ +#if __has_include() #import +#else +#import "RCTBridge.h" +#endif @implementation UIView (React) diff --git a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/include/stripe_objc-umbrella.h b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/include/stripe_objc-umbrella.h index b77b3627c..7232e69b6 100644 --- a/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/include/stripe_objc-umbrella.h +++ b/packages/stripe_ios/ios/stripe_ios/Sources/stripe_objc/include/stripe_objc-umbrella.h @@ -1 +1,5 @@ +#if __has_include() #import +#else +#import "RCTBridge.h" +#endif