iOS Integration Guide

Complete Swift / Xcode implementation

Live APNs Diagnostics

DB token (UserProfile.apns_device_token)

null — not registered

Logged-in user

Not logged in — token registration requires login

❌ No APNs token registered yet

Your device hasn't registered a push token. Follow these steps:

  1. Open TestFlight → update to the latest build
  2. Go to iPhone Settings → Notifications → TrafficWardenAlert → make sure Allow Notifications is ON
  3. Force-quit the app (swipe up from app switcher) then reopen it
  4. Log in to your account inside the app
  5. Wait 10 seconds, then tap Refresh above

If the token still doesn't appear after following these steps, the Xcode project may be missing the Push Notifications entitlement — see section 4.

0. Xcode Project Setup

How to create the Xcode project and where to put each file. Follow these steps in order before touching any code.

  1. Create a new Xcode project (App template, SwiftUI lifecycle)
  2. Replace TrafficWardenAlertApp.swift and create ContentView.swift with code from sections 1 & 2
  3. In Xcode → Target → Signing & Capabilities, add: Push Notifications + Background Modes (remote-notification) + Time Sensitive Notifications
  4. Add the entitlements and Info.plist keys from section 4
  5. Create a loud alarm sound (warden_alert.aiff) and add it to the Xcode bundle — see section 3
  6. Add the background notification handler and TokenStore patch from section 3 to AppDelegate
  7. Build & run on a real device (push doesn't work on Simulator)
  8. Accept notification permission prompt — token is auto-registered to your account

⚠️ Why alerts don't work on lock screen without this

JavaScript (the siren + banner) is frozen when the phone is locked. The ONLY way to alert users on a locked screen is via APNs with a bundled sound file. Once the user taps the notification and opens the app, the JS banner + siren fire immediately via the pending alert injection.

Your Privacy & Cookie Choices

We use essential cookies for login sessions and to deliver warden alerts near your vehicle. We do not use cookies to track you across other apps or websites, and we do not share your data with advertisers. With your consent, we also cache alert data locally for faster access. Read our Privacy Policy to learn how we protect your data under UK GDPR.

You can change your preferences at any time in Settings.

Powered by Google TranslateTranslate