> 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/implement-nfc-wallet/make-payments/implement-contactless-payment/3.-manage-nfcpresentmentintentassertion.md).

# 3. Manage NFCPresentmentIntentAssertion

The `NFCPresentmentIntentAssertion` object is used to block the default payment application from receiving the "double-click" or "field detect" event. Therefore, for non-default payment applications, it is required to use the `NFCPresentmentIntentAssertion` object in order to perform the contactless payment.

Since iOS 18, you are required to use presentment intent assertion in order to receive the event `ContactlessPaymentSession.Event.posConnected` from TSH Pay SDK, which is based on the `CardSession.Event.ReaderDetected` event. If you do not use the presentment intent assertion, the event that your application received will be `NFCWindowSceneEvent.readerDetected` in `SceneDelegate`.<br>

{% hint style="info" %}
When using the `NFCPresentmentIntentAssertion` object, it is important to manage its lifecycle properly.

* The validity of `NFCPresentmentIntentAssertion` object must be maintained while displaying NFC content, and relying on a local variable that is deallocated upon exiting the function may result in unexpected behavior.
* The presentment intent assertion expires after 15 seconds and after it expires, there is a 15-second cool-down period before you can acquire a new instance. To ensure proper integration with `NFCPresentmentIntentAssertion`, you should use it as a global object in order to maintain a `isValid` check to reuse the existing one.
  {% endhint %}

The following code snippet demonstrates how to use the `NFCPresentmentIntentAssertion` object:

```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
    }
}
```

For more information, refer to [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/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.
