Add the #DF24 Developer Keynote to your agenda. Join us in-person on 9/19 at 2:30 p.m. PT or on Salesforce+ at 5 p.m. PT for the must-see session built just for developers.

createTextRecord(payload)

Given a text payload, this function creates a properly formatted NFCRecord to be written to an NFC tag.

  • payload-(Required) A TextPayload object, which contains the text to be converted to an NFC record.

A Promise object that resolves to an NFCRecord object.

A rejected promise returns an NFCServiceFailure.

Use this function to create and return an NFC record to use as a parameter for the write() function.

  • If an error occurs, the error is returned via a rejected promise. Handle errors in a catch clause.
  • When the user cancels the operation, the promise is rejected with a NFCServiceFailure.code value of USER_DISMISSED.

See Also