Overview
Radar’s location verification feature enables you to verify a user’s location with high confidence using device integrity checks and cryptographic attestation. Perfect for geofencing compliance, location-based promotions, fraud prevention, and regulatory requirements.How It Works
Location verification combines:- Device Integrity: Uses Apple’s DeviceCheck framework to verify the device is genuine
- Location Accuracy: Validates GPS accuracy and checks for spoofing
- Cryptographic Token: Returns a signed JWT that can be verified server-side
- Fraud Detection: Checks for VPNs, proxies, emulators, and location spoofing
- Jurisdiction Validation: Optionally validates the user is in expected country/state
Prerequisites: SSL pinning must be configured before using verified tracking. This prevents man-in-the-middle attacks and ensures secure communication.
Setting Up SSL Pinning
Configure SSL pinning before calling any verified tracking methods:Track Verified Location
Track a user’s location with device integrity verification:Track Verified with Options
Specify accuracy, beacon ranging, and additional context:Track Verified Parameters
| Parameter | Type | Description |
|---|---|---|
beacons | BOOL | Whether to range nearby beacons for additional verification. |
desiredAccuracy | RadarTrackingOptionsDesiredAccuracy | Desired GPS accuracy (high, medium, low). |
reason | String? | Optional reason for verification (e.g., “checkout”, “sign_in”). |
transactionId | String? | Optional transaction or session ID for tracking. |
Continuous Verified Tracking
Start continuous background tracking with verification:Stop Verified Tracking
Verified tracking runs in addition to regular tracking. It generates verified location tokens at specified intervals.
Getting Verified Location Token
Retrieve a cached verified location token if still valid:Clear Cached Token
Verified Location Token
TheRadarVerifiedLocationToken object contains:
Jurisdiction Validation
Set expected jurisdiction (country and state) to verify user location:Listening for Verified Tokens
ImplementRadarVerifiedDelegate to receive verified location tokens:
Server-Side Verification
Verify the JWT token server-side using your Radar secret key:Failure Reasons
Common failure reasons include:| Reason | Description |
|---|---|
jurisdiction_mismatch | User is not in the expected country or state |
location_spoofing | Location spoofing detected |
device_integrity_failed | Device failed integrity checks |
inaccurate_location | GPS accuracy is insufficient |
vpn_detected | VPN or proxy detected |
emulator_detected | App running on emulator/simulator |
low_confidence | Location confidence is below threshold |
Fraud Detection Events
When fraud is detected, Radar generates a fraud event:Use Cases
Sports Betting
Verify users are within legal jurisdictions before allowing betting transactions.
Age-Restricted Content
Confirm user location for geo-restricted content and compliance with regional regulations.
Fraud Prevention
Detect location spoofing, VPNs, and other fraudulent behavior for financial transactions.
Promotional Eligibility
Verify customers are at physical store locations for in-store promotions and offers.
Attendance Verification
Confirm employees or students are physically present at required locations.
Insurance Claims
Verify location of insurance claims to prevent fraud and ensure accuracy.
Best Practices
Enable SSL Pinning
Always configure SSL pinning before using verified tracking. This is required and prevents security vulnerabilities.
Verify Tokens Server-Side
Never trust client-side verification alone. Always verify JWT tokens on your server using your secret key.
Handle Failures Gracefully
Check
passed status and failureReasons. Provide clear messaging to users when verification fails.Set Appropriate Jurisdiction
If using jurisdiction validation, ensure country and state codes are set before tracking.
Monitor Token Expiration
Verified tokens expire after a short time. Request fresh tokens when needed rather than caching indefinitely.
Testing
Test Checklist
- SSL pinning configured
- Test on physical iOS device (not simulator)
- Test with real GPS location (not mocked)
- Verify tokens server-side
- Test with VPN enabled (should fail)
- Test jurisdiction validation
- Test token expiration handling
- Test failure scenarios
For more details on fraud detection, visit the Radar documentation.