# NFC Set Publishing State

Starts or stops the Publishing State of an NDEF Message to another Device or Tag. When an NDEF message is ready to be transmitted, it needs to be set to Start by the sender device and to Stop after the transfer is done.

Action available for the following operating systems:

![](/files/kfMeq0OanEe5OOx5RmUn)

### Parameters

* **State** numeric - Specifies whether to start or stop publishing a message. It can be one of:
  * 1 - **Start** - Starts the publishing of the NDEF Message. When a device or tag is in range and the message was written, **NFC Message Send Event** is triggered and you can set the state to Stop if no further writing is to be done.
  * 2 - **Stop** - Stops the publishing of the NDEF Message. You should set this state when no further writing is required.
* **Message Destination** numeric - Specifies where the message should be sent to. It can be one of:
  * 1 - **Another NFC device** - The NDEF Message will be written only when another NFC device is in range.
  * 2 - **Write to an NFC tag** - The NDEF Message will be written only when an NFC tag is in range.
  * 3 - **Write to an NFC tag and make tag Read Only** - The NDEF Message will be written only when an NFC tag is in range and the tag will be locked making it read only.
  * 4 - **Make NFC tag Read Only** - When an NFC tag is in range it will be locked making it read only.
* **NDEF Message** string - NDEF message to be sent to another device or written in an NFC Tag. This Message should have been previously created by **NFC Create Ndef Message**.

{% hint style="info" %}
If you want to write an NDEF message to a tag or send it to another device, you use this action to start publishing the message. If the message is successfully sent to another device or tag, the event **NFC Message Sent** is triggered. At this point you can let the device in a publishing state so it can send the message to another device/tag or you can call this action to Stop publishing so no more messages are sent.
{% endhint %}

{% hint style="info" %}
Making NFC tags read only is only supported on Android. It is possible that a tag gets written and the locking fails, if it goes out of range in that precise moment, but in that case the "NFC Message Sent" event will not be triggered.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://doc.sysdevmobile.com/kalipso5/developing/form/actions/actions-description/group-rfid/nfc-set-publishing-state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
