NFC tags are small chips embedded into stickers or cards [maybe include why they’re embedded]; when an NFC reader is near an NFC tag, it detects the tag and reacts accordingly. This same technology is used in tap-to-pay credit cards, door locks that use tag-based entry, and more.
With iOS 13, you can use the Shortcuts app to program your own actions that run whenever your iPhone is in the vicinity of an NFC tag. You can use this for reminders for certain actions, home automation tasks, and more.
In this tutorial, I’ll show you how to create an iOS Shortcut that runs an action whenever your device is close to an NFC tag.
SEE: 10 free alternatives to Microsoft Word and Excel (TechRepublic download)
How to set up the NFC tag trigger in iOS 13
The Apple Shortcuts app is already installed on your iOS 13 devices and is used to create custom automations for your iOS devices. With iOS 13, Apple added the ability to create custom automations using various triggers. One of the new triggers in the app is using NFC tags to trigger shortcuts when your device is near one of the tags. You’ll find this feature in the new Automation tab of the Shortcuts app.
- Create a new automation in the Automation tab.
- Select Create Personal Automation.
- Select NFC (Figure A).
- Tap the Scan button, and place the tag near the top of your iPhone so it can read the tag.
- Name the tag in the text field that pops up after scanning.
- Tap Next to configure and set up the automations you wish to run when this tag is scanned.
Use any of the actions in the Shortcuts app when setting up this automation, HomeKit actions included.
How to use NFC tags
NFC tags come in all shapes, sizes, and appliances. Whether you want NFC cards, stickers, or plastic tags, the choice depends on where they are used for the Shortcuts app. NFC tags can be purchased for an affordable price from many online retailers, including Amazon.
For example, I have one placed at my desk that, with one tap of my device, allows me to set my chat status, turn on the office lights, and more.
You can place one at your front door to unlock it and to turn on the lights in your home, thanks to HomeKit integration. There are lots of possibilities with this feature.
Each NFC tag has a unique number encoded on it, and that code is what the iPhone uses to trigger the shortcut to run on your device. The shortcut is not encoded onto the NFC chip; rather, your device sees the serial number of the tag and knows what to do when placed in the presence of that tag.
Note: Personal automations are not shared via iCloud and cannot be transferred between devices. When you create a Shortcut automation using the NFC tags, it works only with your single device. To use the same automation on other devices, you must use the same setup process on each one.
How to trigger shortcuts with NFC tags
To trigger the action you created, place your device on top of the NFC tag, and you will receive a notification that the action is being run (Figure B).
If the action requires that the Shortcuts app is open, you will see a small arrow icon in the notification. Tapping the notification opens the Shortcuts app and runs the actions that you set up.
Subscribe to the Developer Insider Newsletter
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays