2. Manage the default payment application

Last updated
Was this helpful?
The default payment application is launched when the end user performs a double-click or field-detect action.
The double-click payment experience can be enabled or disabled by the end user.

If your application receives the NFC launch events below when the end user performs a double-click or field-detect action, it indicates that your payment application is set as the default payment application.
You can still perform a contactless payment when the application is not set as the default payment application. However, a double-click or field-detect action may bring the default application to the foreground.
Last updated
Was this helpful?
Was this helpful?
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
// to support initiate contactless payments by double-click or field-detect action
// when application is not running + application is the default payment application
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
if #available(iOS 17.4, *) {
if let nfcEvent = connectionOptions.nfcEvent {
switch nfcEvent {
case .presentation:
// use case for double-click
break
case .readerDetected:
// use case for field-detect
break
@unknown default: break
}
}
}
}
}
extension SceneDelegate: NFCWindowSceneDelegate {
@available(iOS 17.4, *)
// to support initiate contactless payments by double-click or field-detect action when application is background or foreground and is the default payment application
func windowScene(_ windowScene: UIWindowScene, didReceiveNFCWindowSceneEvent event: NFCWindowSceneEvent) {
switch event {
case .presentation:
// use case for double-click
break
case .readerDetected:
// use case for field-detect
break
@unknown default: break
}
}
}