> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/ja/implement-nfc-wallet/make-payments/implement-contactless-payment/2.-manage-the-default-payment-application.md).

# 2. デフォルトの支払いアプリケーションを管理する

デフォルトの支払いアプリは、エンドユーザーが次の操作を行うと起動されます [ダブルクリック](/nfc-wallet-sdk-ios/ja/implement-nfc-wallet/make-payments/implement-contactless-payment.md#double-click) または [フィールド検出](/nfc-wallet-sdk-ios/ja/implement-nfc-wallet/make-payments/implement-contactless-payment.md#field-detect) 操作。

ダブルクリックによる支払い体験は、エンドユーザーが有効または無効にできます。

<figure><img src="https://3629066568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6bUtiXdSFHu8lmOj8A0X%2Fuploads%2FIptYwGEowpiVZwV2cbF0%2F2.%20Manage%20the%20default%20payment%20application.png?alt=media&amp;token=a4d4bbe3-06cd-4a8d-91f9-b80a084af8a4" alt="" width="563"><figcaption><p>デフォルトの支払いアプリのエンドユーザー設定</p></figcaption></figure>

エンドユーザーがダブルクリックまたはフィールド検出の操作を行ったときに、アプリケーションが以下のNFC起動イベントを受信する場合、それは支払いアプリケーションがデフォルトの支払いアプリケーションに設定されていることを示します。

{% code expandable="true" %}

```swift
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
        
    // ダブルクリックまたはフィールド検出の操作による非接触決済の開始をサポートするため 
    // アプリケーションが実行されていない場合 + アプリケーションがデフォルトの支払いアプリケーションである場合
    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:
                    // ダブルクリックのユースケース
                    break
                case .readerDetected:
                    // フィールド検出のユースケース
                    break
                @unknown default: break
                }
            }
        }
    }

}


extension SceneDelegate: NFCWindowSceneDelegate {
    @available(iOS 17.4, *)
    // アプリケーションがバックグラウンドまたはフォアグラウンドにあり、デフォルトの支払いアプリケーションである場合に、ダブルクリックまたはフィールド検出の操作による非接触決済の開始をサポートするため
    func windowScene(_ windowScene: UIWindowScene, didReceiveNFCWindowSceneEvent event: NFCWindowSceneEvent) {
        switch event {
        case .presentation:
            // ダブルクリックのユースケース
            break
        case .readerDetected:
            // フィールド検出のユースケース
            break
        @unknown default: break
        }
    }
}
```

{% endcode %}

{% hint style="info" %}
アプリケーションがデフォルトの支払いアプリケーションに設定されていなくても、非接触決済は引き続き実行できます。ただし、ダブルクリックまたはフィールド検出の操作によってデフォルトのアプリケーションが前面に表示される場合があります。
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/ja/implement-nfc-wallet/make-payments/implement-contactless-payment/2.-manage-the-default-payment-application.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
