The Story: A Simple Requirement Meets Too Much Curiosity
A while ago, I received a fairly straightforward ticket in our sprint: "Allow users to add their loyalty cards to Apple Wallet and Google Wallet."
Standard stuff, right? You generate the pass, set a few parameters, and call it a day. But my engineer brain (and a bit of personal motivation) decided to take it a step further.
My wife loves grocery shopping, but she doesn't stick to a single supermarket chain—she likes comparing prices across different competitors. As a developer who loves spatial data, I decided to build a subtle, affectionate "reminder" of where her husband worked. 😅
I wanted her digital loyalty card to trigger a personalized location notification on her phone whenever she walked near our stores... or whenever she visited the competition.
The Technical Challenge: Beating Wallet Limits
Apple and Google Wallets allow you to define geographic coordinates on a pass so the OS shows a lock-screen notification when the user is nearby. However, they impose a strict limit on the number of static locations you can embed into a single pass (Apple Wallet, for instance, caps static locations at 10).
You cannot simply push hundreds of store locations to every user's device.
The Solution: An Adaptive Spatial Engine
To solve this, I designed a dynamic backend mechanism that updated the pass metadata on the fly:
- User Habit Analysis: The system analyzed purchase history and frequent geographic clusters to identify the user's daily shopping routes.
- Competitive Mapping: Using spatial indexing (PostGIS / H3), the engine queried the nearest company stores AND competitor locations relative to the user's active zones.
- Dynamic Push Updates: Instead of static coordinates, the backend continuously refreshed the pass payload with the 10 most relevant, high-probability locations via Apple/Google Push Notification services (APNs/FCM).
If my wife decided to change her routine or try a new supermarket to avoid my notifications, the algorithm adapted to her new patterns and updated the active geofences in her device's background.
Lessons Learned
What started as a fun personal project turned into a highly resilient, location-aware engine. It taught me how to push the boundaries of native OS features by shifting the heavy lifting to a smart spatial backend.
Sometimes, the most innovative architecture patterns don't come from a 50-page requirements document—they come from trying to solve everyday problems with a passion for spatial engineering.
This mindset of building adaptive, high-concurrency spatial engines is actually what drove me to keep building more complex systems in this domain.
Have you ever built something unconventional or fun using spatial data or push services? I'd love to hear your thoughts and approaches in the comments!
Top comments (0)