so my goal is to have the apple pay button show up on devices that support apple pay and be hidden on devices that do not support it.
Currently I have a vc with two buttons, one is an Apple Pay button and one is a button that segues to a normal checkout. I use logic to determine the right buttons to show, if the device supports Apple Pay it'll show both, if not, it'll show the normal checkout button.
Here is an example of the simulator, a device that supports Apple Pay:
This is what it should look like for a device that supports Apple Pay. Here is the logic I use to determine what buttons to show:
func checkIfApplePaySupported() {
if StripeAPI.deviceSupportsApplePay() == false {
applePayButton.isHidden = true
} else {
applePayButton.isHidden = false
applePayButton.addTarget(self, action: #selector(applePayTapped), for: .touchUpInside)
}
}
Pretty straightforward, works perfectly fine on simulator. I hide the Apple Pay button originally in the storyboard so it doesn't have any choppy UI movement when the view loads. I call that method in the viewDidLoad()
of the vc.
Now the issue is when I uploaded the build to TestFlight with that exact logic, the Apple Pay button does not show in the vc when testing on my iPhone. I have Apple Pay setup, there is a card in my Wallet, matter a fact, I paid for my groceries yesterday with Apple Pay so there is no doubt the device supports Apple Pay.
This is the outcome I get every time I get to that vc :
The Apple Pay button never shows up despite the fact my device whole heartedly supports Apple Pay, this is like the weirdest bug and I can't figure out what I'm doing wrong for the life of me. This was happening with my friends as well, their device supported Apple Pay but they couldn't see the Apple Pay button as well and make payments with it. Any suggestions on how I can fix this bug?