Description
Describe the bug
I have done a transaction via Apple Pay on a real device. After a successful transaction, when I go for the next transaction again and try to open Apple Pay again, it does not open.
start('applepay')
To Reproduce
Steps to reproduce the behavior:
- Go for transaction via apple pay
- even it's fail or successful. then again for for another transaction
- apple pay is not opening
Expected behavior
it should open the apple pay even for second payment
Screenshots
Smartphone (please complete the following information):
- Device: iphone
- Adyen sdk version: 2.4.0
Additional context
Error on xcode:
[Presentation] Attempt to present <PKPaymentAuthorizationViewController: 0x107d23f00> on <RNSScreen: 0x106e9edf0> (from <RNSScreen: 0x106e9edf0>) whose view is not in the window hierarchy.
i'm suspecting an issue on this block.
internal func present(_ component: PresentableComponent) {
guard let presenter = BaseModule.currentPresenter ?? UIViewController.topPresenter else { return sendEvent(error: NativeModuleError.notKeyWindow) }
defer {
BaseModule.currentPresenter = presenter
}
guard component.requiresModalPresentation else {
presenter.present(component.viewController, animated: true)
return
}
let navigation = UINavigationController(rootViewController: component.viewController)
component.viewController.navigationItem.rightBarButtonItem = .init(barButtonSystemItem: .cancel,
target: self,
action: #selector(cancelDidPress))
presenter.present(navigation, animated: true)
}
it's going to else condition in
guard component.requiresModalPresentation else {
presenter.present(component.viewController, animated: true)
return
}