Braintree Drop In Apple Pay crashing

心不动则不痛 提交于 2020-01-30 11:50:12

问题


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:


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.

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



来源:https://stackoverflow.com/questions/53658240/braintree-drop-in-apple-pay-crashing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!