Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adyen Appearance React native IOS #562

Open
faizantariq2 opened this issue Dec 23, 2024 · 4 comments
Open

Adyen Appearance React native IOS #562

faizantariq2 opened this issue Dec 23, 2024 · 4 comments
Labels
bug Something isn't working iOS SDK This feature is missing on latest adyen-ios

Comments

@faizantariq2
Copy link

faizantariq2 commented Dec 23, 2024

Describe the bug
I want to change the background color of the card component button. Instead of using the tint color that changes all the fields' colors, I want to change only the background color of the button. When I use the tint color constructor, it works fine, but when I try to change only the button's background color, I get a runtime error.

To Reproduce
Steps to reproduce the behaviour:

  1. Add below code in AdyenAppearance.swift class.

import Adyen
import adyen_react_native
import Foundation
/// Please make sure that the name of the class exactly matches.
/// SDK will use reflection to find the class with this exact name.
class AdyenAppearance: AdyenAppearanceProvider {

static func createStyle() -> Adyen.DropInComponent.Style {
var style = Adyen.DropInComponent.Style()
style.formComponent.mainButtonItem.button.backgroundColor = .red
return style
}
}
2. run app and open card component you will get the error

Expected behavior
It should only change the background color of the button of card component

Screenshots
Screenshot 2024-12-23 at 18 23 10

Smartphone (please complete the following information):

  • Device: IOS simulator

Additional context
Add any other context about the problem here.

@faizantariq2 faizantariq2 added the bug report when a bug report is created label Dec 23, 2024
@descorp
Copy link
Contributor

descorp commented Dec 24, 2024

Hey @faizantariq2

This is known behaviour of iOS SDK - somehow Swift is incorrectly allocating memory for a big value type.
From what we know it is only reproducible on device in DEBUG mode.
There is no known workaround, but maybe you can do something like:

        #if DEBUG
            return .init(tintColor: .systemTeal)
        #else
           var style = Adyen.DropInComponent.Style()
           style.formComponent.mainButtonItem.button.backgroundColor = .red
           return style
        #endif

@faizantariq2
Copy link
Author

faizantariq2 commented Dec 26, 2024

thanks, yes in release mode it's not crashing.

@descorp
Copy link
Contributor

descorp commented Jan 2, 2025

Thanks for confirming @faizantariq2

We will look into this issue.

@descorp descorp added bug Something isn't working iOS SDK This feature is missing on latest adyen-ios and removed bug report when a bug report is created labels Jan 2, 2025
@faizantariq2
Copy link
Author

@descorp , one more thing, as far as I remember, it was working fine in the 1.2.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS SDK This feature is missing on latest adyen-ios
Projects
None yet
Development

No branches or pull requests

2 participants