When I try to compile react-native app for iOS below code block for ApplePay
let applePayController = PKPaymentAuthorizationViewController(paymentRequest: request)
applePayController.delegate = self
let rootViewController:UIViewController? = UIApplication.shared.delegate?.window??.rootViewController!
rootViewController!.present(applePayController, animated: true, completion: nil)
throwing run-time error.
Value of optional type 'PKPaymentAuthorizationViewController?' must be unwrapped to refer to member 'delegate' of wrapped base type 'PKPaymentAuthorizationViewController'
how can I solve this issue?