Adyen / adyen-ios

Adyen iOS Drop-in and Components
https://docs.adyen.com/checkout/ios
MIT License
151 stars 120 forks source link

[Feature] Integrate 3DS2 as a static framework within the Checkout SDK #1500

Open LauraBejan-Nestle opened 9 months ago

LauraBejan-Nestle commented 9 months ago

Describe the bug We are trying to build a host app that consumes a framework that will consume the Adyen package. Host App -> Framework A -> Adyen-ios (Adyen and AdyenDropIn - the one that's crashing). Unfortunately, at runtime, the app crashes with the error described in the screenshot below.

To Reproduce Steps to reproduce the behavior:

  1. Create Host App with static embedded Framework A.
  2. Add Adyen-ios package 5.5.0 through SPM to Framework A.
  3. Select Adyen and Adyen DropIn modules
  4. Run Host App on device
  5. App will crash

Expected behavior Between Framework A and Adyen-ios the linkage should be static and the app should not crash.

Screenshots image

Environment

Additional context The behaviour described above happens only when running the app on device, the simulator does not encounter any issues. The issue does not reproduce when Adyen package is imported directly in Host App.

erenbesel commented 9 months ago

Hi @LauraBejan-Nestle This is a hard one to test from our side. Since the error seems to refer to the 3ds2 package, could you try experimenting with different packages in the Adyen package that does not link the Adyen3DS2, such as AdyenCard or AdyenComponent, instead of AdyenDropIn?

LauraBejan-Nestle commented 9 months ago

Hello @erenbesel,

I have tried the approach you recommended, but, unfortunately, it's not what I need. I need to have access to DropInComponent which is exposed in AdyenDropIn. I have created a repo with the setup described in the issue. I hope it will help with the investigation. https://github.com/LauraBejan-Nestle/Adyen-ios-Runtime-issue/tree/main

martyhoogendam commented 7 months ago

Also experiencing this exact issue unfortunately (with SDK 5.6.0)...

@LauraBejan-Nestle Have you been able to find a solution or workaround?

@erenbesel Any chance you can look into this? With Laura's repo you should be able to reproduce the issue. Help would be greatly appreciated, as we're dealing with a deadline.

robertdalmeida commented 7 months ago

Thanks for the sample app it helps to see the issue.

I don't think you can create a static framework to wrap a framework which dynamically links to another.

Suggestions:

  1. Make the wrapper framework dynamically linked to the main app.
  2. fork your own version of adyen-ios and make the link to Adyen3ds2 sdk a static one. A static framework is available in the repo.
LauraBejan-Nestle commented 7 months ago

Hello,

Thank you for the response. We discussed internally when the issue was raised and we also went with solution 2, creating a fork and removing any reference we do not need.

A solution from your side would be to support both statically and dynamically linked from within your own package by creating 2 different targets.

For now this is ok as we fixed the blocking issue with the fork.

martyhoogendam commented 7 months ago

@robertdalmeida Thanks for your response.

I don't think solution 1 will actually work. In our project (and the sample app), the wrapper framework is already dynamically linked to the main app. As @LauraBejan-Nestle suggests, please offer both a static and dynamic target in the adyen-ios SPM package.

This is supported by many SPM packages (see screenshot for an excerpt from our dependencies) and would make the Adyen DropIn usable for our project.

Screenshot 2024-03-18 at 15 52 54