> 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/3.-manage-nfcpresentmentintentassertion.md).

# 3. NFCPresentmentIntentAssertion を管理する

この `NFCPresentmentIntentAssertion` オブジェクトは、既定の支払いアプリケーションが「ダブルクリック」または「フィールド検出」イベントを受信するのをブロックするために使用されます。したがって、既定以外の支払いアプリケーションでは、 `NFCPresentmentIntentAssertion` 非接触決済を行うために、オブジェクトを使用する必要があります。

iOS 18以降、イベントを受信するには presentment intent assertion を使用する必要があります `ContactlessPaymentSession.Event.posConnected` TSH Pay SDK からのもので、これは次の `CardSession.Event.ReaderDetected` イベントです。presentment intent assertion を使用しない場合、アプリケーションが受信するイベントは `NFCWindowSceneEvent.readerDetected` で `SceneDelegate`.<br>

{% hint style="info" %}
次の `NFCPresentmentIntentAssertion` オブジェクトを使用する場合、そのライフサイクルを適切に管理することが重要です。

* 次の有効性は `NFCPresentmentIntentAssertion` オブジェクトは NFC コンテンツを表示している間、維持する必要があり、関数を抜けると解放されるローカル変数に依存すると、予期しない動作につながる可能性があります。
* presentment intent assertion は15秒後に期限切れとなり、期限切れ後は新しいインスタンスを取得するまで15秒のクールダウン期間があります。〜との適切な統合を確実にするには `NFCPresentmentIntentAssertion`、有効性を維持するために、グローバルオブジェクトとして使用する必要があります `isValid` 既存のものを再利用するための確認です。
  {% endhint %}

以下のコードスニペットは、次の `NFCPresentmentIntentAssertion` オブジェクトの使用方法を示しています:

```swift
import CoreNFC

@available(iOS 17.4, *)
class PresentmentIntentWrapper {
    
    static var presentmentIntent: NFCPresentmentIntentAssertion?
    
    static func acquire() async throws {
        presentmentIntent = try await NFCPresentmentIntentAssertion.acquire()
    }
    
    static func isValid() -> Bool {
        guard let presentmentIntent else {
            return false
        }
        return presentmentIntent.isValid
    }
}
```

詳細については、 [NFCPresentmentIntentAssertion](https://developer.apple.com/documentation/corenfc/nfcpresentmentintentassertion).


---

# 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/3.-manage-nfcpresentmentintentassertion.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.
