I want to create an example project that opens an Apple Pay sheet when a user clicks the "Pay using Apple Pay" button in their application.
I am testing my application on iPhone 6 with iOS version 8.1 (which contains Apple Pay) and Xcode 6.1 GM. Both of them have not yet been officially released.
I followed the tutorial on this page . And this is my code for handling the on-click event of the Pay with Apple Pay button:
PKPaymentRequest *request = [PKPaymentRequest new];
By clicking on the "Pay using Apple Pay" button, I received this error:
Application termination due to an uncaught exception "NSInvalidArgumentException", reason: "Application tried to present nil modal view controller to target
When checking PKPaymentAuthorizationViewController canMakePayments] it returns false.
I am not sure why my error is related to iPhone setup or my code.
Does anyone have experience with Apple Pay? Please help me. Thank you very much.
source share