Skip to content

Make hide(true|false) async to resolve Apple Pay dismiss #577

Open
@faizantariq2

Description

@faizantariq2

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:

  1. Go for transaction via apple pay
  2. even it's fail or successful. then again for for another transaction
  3. 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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions