stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

shared is unavailable in application extensions for iOS

Open KashifJavaid opened this issue 1 year ago • 0 comments
trafficstars

I am experiencing an issue when integrating the Stripe SDK into my iOS application, particularly when using the SDK within an application extension. Specifically, the build fails with the following error message:

'shared' is unavailable in application extensions for iOS: Use view controller based solutions where appropriate instead.

This error is encountered in the STPRedirectContext.swift file at line 105.

Steps to Reproduce:

Add the Stripe SDK to a project that includes an application extension. Attempt to build the project. Observe the build failure with the aforementioned error. Environment:

Stripe SDK Version: 0.37.3 Xcode Version: 15.3 iOS Deployment Target: 13 React Native Version : 0.73.2

Snippet of podfile

target 'TheNotificationService' do
  pod 'Ometria', :modular_headers => true
  pod 'Stripe', :modular_headers => true
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
    end
  end
end

also look at https://github.com/stripe/stripe-ios/issues/2853

Screenshot 2024-07-18 at 10 14 58

Issue Description:

The shared method, which is used in the Stripe SDK, is unavailable for application extensions in iOS. This causes a build failure when attempting to use the SDK within an extension. The error suggests using view controller-based solutions instead, but this adjustment is within the Stripe SDK itself and not within my control as an integrator.

Request:

I kindly request that the Stripe SDK be updated to ensure compatibility with application extensions in iOS by avoiding the use of the shared method or providing an alternative approach that is suitable for use in extensions.

Please let me know if you need any additional information or if there are any workarounds available in the meantime. Your assistance in resolving this issue would be greatly appreciated.

Thank you for your support.

Best regards,

KashifJavaid avatar Jul 18 '24 09:07 KashifJavaid