HTron
HTron

Reputation: 366

Braintree Drop In Apple Pay crashing

Presenting PKPaymentAuthorizationViewController always results in a total crash with pointing to my AppDelegate: Thread 1: signal SIGABRT

let vc = PKPaymentAuthorizationViewController(paymentRequest: paymentRequest) as PKPaymentAuthorizationViewController?

if vc != nil{

    vc!.delegate = self

    self.present(vc!, animated: true, completion: nil)

}else{
    print("error")
}

libc++abi.dylib: terminating with uncaught exception of type NSException

btw.: I am checking .canMakePayments() if it is available first.

The exception message is

Supported orientations has no common orientation with the application, and [PKPaymentAuthorizationViewController shouldAutorotate] is returning YES

Upvotes: 0

Views: 175

Answers (1)

Paulw11
Paulw11

Reputation: 115041

The PKPaymentAuthorizationViewController is presented in portrait orientation so that FaceID functions correctly.

You are getting an exception as you have only landscape options selected under 'Device Orientation' in your project. You need to add portrait to this list.

enter image description here

You can limit the rest of your view controllers to landscape orientation if that is what you want.

Upvotes: 1

Related Questions