Erase the contents of an NFC tag.
erase() is an inherently dangerous action, as it allows data to be irreversibly deleted. Use caution when using this functionality in your component. At an absolute minimum, consider adding a confirmation window for your users that clearly states the outcome of the action, with an option for them to cancel if they wish.
erase() function can only be performed on writable NFC tags. Attempting this function on a read-only NFC tag will result in an error.
NFCServiceOptionsobject to configure the NFCService request.
If successful, the value of the
successText property on the
NFCServiceOptions object is returned by the OS. If unsuccessful, an error message is returned.
Use this function to erase data from an NFC tag.
- If an error occurs, the error is returned via a rejected promise. Handle errors in a
- When the user cancels the operation, the promise is rejected with a
NFCServiceFailure.codevalue of USER_DISMISSED.