Braintree Drop In Apple Pay crashing

2019-03-03 13:45发布

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

1条回答
Emotional °昔
2楼-- · 2019-03-03 14:19

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.

查看更多
登录 后发表回答