Closed joshgare closed 5 years ago
The problem is that you're not holding onto the paySession
reference that you're creating (in your first snippet). The PaySession
object manages all interactions with the PassKit so if you don't keep it alive for the duration of the interaction, none of the callbacks will be handled. It also sounds like your BasketViewController
should be the owner of PaySession
.
Thanks for the clarification, retaining the PaySession
has fixed this!
I am trying to implement Apple Pay into my iOS app. I have followed the examples on readme in this repo and the Storefront example app.
I have a
BasketViewController
that brings up the Apple Pay authorisation sheet with the following code.I have also implemented the following to ensure
BasketViewController
conforms to thePaySessionDelegate
.However none of the delegate methods are being called when interacting with the Apple Pay sheet which loads as expected in the app. Strangely though, the cancel button the Apple Pay sheet doesn't seem to be working either - which makes me think there is a problem with the
PKPaymentAuthorizationControllerDelegate
methods in the Mobile Buy SDK.I tried digging deeper with some break points to see what was going on. I can confirm that the
PaySessionDelegate
points towards theBasketViewController
. I also set breakpoints in thePKPaymentAuthorizationControllerDelegate
definitions inPaySession.swift
and none of those methods were being called either so it seems there is a problem there hence why none of the PaySessionDelegate` methods are being called.I have been trying this on iOS 12 on device and on the simulator using 3.3 of the Mobile Buy SDK.