Mc Sibi
Mc Sibi

Reputation: 119

Can I suppress the Apple Pay popup in my app?

I have created an app with the Core Bluetooth framework. My IOT device contains both Bluetooth and NFC. When I bring my Apple device in to NFC range, the Apple Pay popup triggers.

Is their any way to suppress the Apple Pay popup while my app is in the foreground or background?

Upvotes: 6

Views: 5903

Answers (2)

Paulw11
Paulw11

Reputation: 114773

First, I would have thought that you would be able to make a Bluetooth connection without getting close enough for the NFC to be detected, but that isn't your question.

You can suppress the Apple Pay display when your app is in the foreground by calling requestAutomaticPassPresentationSuppression(responseHandler:) from the PassKit framework.

Note that:

This method requires a special entitlement issued by Apple. If the entitlement is not present, the request will fail with a PKPassLibrary result.

Specifically, you need the com.apple.developer.passkit.pass-presentation-suppression entitlement.

If this app is for your own use you should be able to just add this entitlement to your entitlements file. To submit it to the App Store you will need to contact Apple to get this entitlement.

You cannot suppress Apple Pay when your app is not in the foreground.

Upvotes: 16

Christos Chadjikyriacou
Christos Chadjikyriacou

Reputation: 3749

To suppress the presentation of the Apple Pay dialog when it detects a compatible reader, there is an entitlement required in order for the requestAutomaticPassPresentationSuppression(responseHandler:) method to function in the desired manner.

To request the special entitlement, email [email protected]. Be sure to include information about your company and describe the use case requiring suppression of the Apple Pay dialog. Once you have the entitlement, you can go ahead with using the requestAutomaticPassPresentationSuppression(responseHandler:) method.

Upvotes: 4

Related Questions