A live GPS emergency safety app for NJIT students built with SwiftUI.
Campus Shield connects students directly to NJIT Public Safety with one tap — sharing real-time GPS coordinates, enabling emergency chat with media sharing, and providing multiple discreet SOS triggers including volume buttons, shake detection, back tap, a lock screen widget, and a Siri shortcut.
- One-tap connect to NJIT Public Safety (973-596-3111)
- Auto-dials on emergency activation
- Call 911 and Text 911 buttons available in the dashboard
- Automated 911 text includes live GPS coordinates, accuracy, elevation, and direct Apple Maps + Google Maps links
- Real-time latitude, longitude, altitude, speed, and accuracy
- Barometric altimeter (relative) with GPS absolute fallback
- Sea level elevation display (WGS84)
- GPS accuracy tier system: Excellent / Good / Fair / Signal Lost
- Location silently starts on app launch so coordinates are ready immediately
- Real-time message interface with NJIT Public Safety
- Quick reply buttons for common emergency phrases
- Photo and video sharing via camera capture or photo library
- Full-screen photo preview
- iCloud video support via
PHImageManager
Multiple ways to activate the emergency line:
| Trigger | Works When |
|---|---|
| Spam volume button (3×) + shake (3×) within 3 seconds | App is open |
| Double tap back of phone | App is open |
| Lock screen widget tap | Anywhere — no unlock needed |
| Back Tap → Shortcuts deep link | Anywhere (one-time setup) |
Three widget sizes — lock screen circular, lock screen rectangular, and home screen small tile — all one tap away from the emergency dial.
Add screenshots here
- iOS 16.0+
- Xcode 15+
- Real iPhone required (GPS, camera, and accelerometer do not work in the simulator)
git clone https://github.com/yourusername/campus-shield.git
cd campus-shieldopen CampusShield.xcodeprojAdd the following keys to your Info.plist:
| Key | Purpose |
|---|---|
NSCameraUsageDescription |
Camera access for photo/video capture |
NSMicrophoneUsageDescription |
Microphone access for video recording |
NSPhotoLibraryUsageDescription |
Photo library read access |
NSPhotoLibraryAddUsageDescription |
Full photo library access |
NSLocationWhenInUseUsageDescription |
GPS tracking |
NSLocationAlwaysAndWhenInUseUsageDescription |
Background GPS tracking |
NSMotionUsageDescription |
Shake and back tap SOS detection |
In Xcode → Target → Signing & Capabilities:
- Add Background Modes → check Location updates
In Xcode → Target → Info tab → URL Types → add:
- Identifier:
com.campusshield.app - URL Schemes:
campusshield
- File → New → Target → Widget Extension
- Name:
CampusShieldWidget - Uncheck "Include Live Activity" and "Include Configuration App Intent"
- Replace the generated Swift file contents with
NJITSafetyWidget.swift
Select your iPhone as the build target and hit Run.
To enable double-tapping the back of your phone as an SOS trigger from anywhere on the device:
- Open the Shortcuts app
- Tap + → Add Action → search Open URLs → enter
campusshield://sos - Name the shortcut Campus Shield SOS
- Go to Settings → Accessibility → Touch → Back Tap → Double Tap
- Select Campus Shield SOS
A step-by-step guide is also built into the app on the start screen.
CampusShield/
├── Models
│ ├── ChatMessage # Text + optional media attachment
│ ├── GPSReading # Location data with computed properties
│ └── MediaAttachment # Photo or video enum
│
├── Managers
│ ├── LocationManager # CLLocationManager + CMAltimeter
│ └── SOSTriggerManager # Volume + shake + back tap detection
│
├── Views
│ ├── ContentView # Root — routes start vs emergency
│ ├── StartScreenView # Launch screen with SOS hints
│ ├── EmergencyDashboardView # Active emergency UI
│ └── BackTapSetupView # Step-by-step Back Tap guide
│
├── Components
│ ├── ChatBubbleView # Text and media bubbles
│ ├── CoordCell # GPS coordinate display cell
│ ├── StatusPill # Voice / GPS status indicators
│ └── SetupStep # Numbered step card
│
├── Pickers
│ ├── MediaPicker # PHPickerViewController wrapper
│ └── CameraPicker # UIImagePickerController wrapper
│
└── Widget
└── NJITSafetyWidget # Lock screen + home screen widgets
| Contact | Number |
|---|---|
| NJIT Public Safety | 973-596-3111 |
| Emergency | 911 |
- Firebase backend for real-time media delivery to dispatch
- Apple Watch companion app for gesture-based background SOS
- Push notifications from dispatch to user
- Incident history log
- Multi-campus support
Pull requests are welcome. For major changes please open an issue first to discuss what you'd like to change.
Built for NJIT student safety. Not an official NJIT product.