Skip to content

iPhone Shortcut, NFC and foqos

uLockin’s phone trigger lets an iPhone Shortcut start or stop a session in the uLockin tab open on your computer. Put the Shortcut behind an NFC tag and one tap does it.

It pairs well with foqos, which blocks distracting apps through iPhone Screen Time. One tap starts foqos on the phone and a uLockin session on the desktop. The next tap stops both.

  • uLockin open in a browser tab on your computer.
  • An iPhone with the Shortcuts app.
  • Optional: an NFC tag or card, and foqos.

The Shortcut makes a background web request, so nothing opens on the phone. The timer runs in the desktop tab.

  1. On your computer, open ulockin.com and open Settings.

  2. Under Phone trigger, press Make a secret.

  3. The section now shows Connected and four values, each with a Copy button:

    Value Example
    Secret 43 letters, digits, - and _
    Start URL https://ulockin.com/api/trigger/start?work=40&break=15
    Stop URL https://ulockin.com/api/trigger/stop
    Authorization header Bearer followed by your secret

You’ll type or paste the two URLs and the Authorization header into the Shortcut. If your Mac and iPhone share an Apple Account, copy on the Mac and paste on the iPhone. Otherwise send them to yourself in a note.

  1. In the Shortcuts app, make a new shortcut and add the Get Contents of URL action.

  2. Set the URL to your Start URL. Change work and break to the minutes you want.

  3. Open the action’s options and set Method to POST.

  4. Under Headers, add a header. The key is Authorization. The value is your Authorization header value, starting with Bearer.

  5. Optional: add Show Notification and give it the Contents of URL. uLockin answers with one sentence, such as “Start sent to 1 uLockin tab.”

Run the shortcut. The uLockin tab on your computer starts a work session.

A stop Shortcut is the same with the Stop URL. It has no work or break.

foqos adds its own Shortcuts actions, among them Start Foqos Profile, Stop Foqos Profile and Check if Foqos Session is Active. Use them to make one Shortcut that toggles:

  1. Add Check if Foqos Session is Active.

  2. Add an If action on its result.

  3. In the If branch (a session is active), add Stop Foqos Profile, then Get Contents of URL with your Stop URL.

  4. In the Otherwise branch, add Start Foqos Profile, then Get Contents of URL with your Start URL.

  5. Set Method to POST and add the Authorization header on both URL actions, as in step 2 above.

Start foqos with no duration. Then the stop tap, not a timer on the phone, is what unlocks your apps, and uLockin starts your break at that same moment.

  1. In the Shortcuts app, open Automation and make a new automation.

  2. Choose NFC, scan your tag and give it a name.

  3. Choose Run Immediately, so the tap doesn’t ask for confirmation.

  4. Pick the Shortcut you built.

You can make several tags with different timings. For example, one Shortcut with work=40&break=15 for deep work and another with work=15&break=5 for small tasks, each behind its own tag.

A start tap

  • Begins a work session with the tag’s work minutes. The tag’s break is used for the break right after it.
  • The tag’s lengths apply to that one cycle. Your preset doesn’t change.
  • While work is already running or paused, it changes nothing.
  • During a break, it ends the break and begins work.

A stop tap

  • During work, it ends the session now. The minutes you actually worked are logged, the sheet asks what you got done, and your break starts under it.
  • During a break, it starts that break over from the tap.
  • On work that ran for under a minute, it drops the session as a mistaken tap. Nothing is logged.

After a tag’s break ends, the next work session waits for Start or the next tap.

If no uLockin tab is open, the call is held for up to 8 hours. When you open uLockin, it applies the call from the time you tapped, so the timer stays in step with foqos. A held start is dropped once its work time has already passed.

Each browser that has the secret listens. To add a second computer, copy the Secret from Settings, open uLockin’s Settings there and paste it into Or paste a secret from another browser.

The secret is never part of an export file.

Add the Show Notification step to see uLockin’s reply.

Reply What to do
Start held: no uLockin tab is connected. Open uLockin on your computer. The call applies when it connects.
No uLockin has connected with this secret. The secret in the Shortcut doesn’t match one in Settings. Copy the Authorization header again.
Missing or malformed secret. The header’s key must be Authorization and its value Bearer, a space, then the secret.
This secret was replaced. A new secret was made. Copy the new header into your Shortcuts.
Use POST. Set the action’s Method to POST.
work must be whole minutes from 1 to 240. Fix the work or break number in the URL.

For every reply and status code, see the Trigger API.