A Swift Journey Episode 2: Handling Silent Notifications
Article Summary
Arinc Elhan from Connected2.me breaks down silent push notifications in iOS, and there's more to them than just background data delivery. Apple throttles them aggressively, and most developers don't know the limits.
Silent notifications let iOS apps refresh content in the background without alerting users. But Apple restricts them to 2-3 per hour and throttles excessive use. This guide walks through the complete setup process, from certificates to testing with cURL commands.
Key Takeaways
- Apple limits silent notifications to 2-3 per hour under current conditions
- Payload must include content-available key with value of 1
- Use Wait for executable launch scheme to debug background launches
- Convert push certificates to .pem format for local testing
Silent notifications are powerful for background updates but come with strict Apple-imposed limits that require careful implementation and testing strategy.
About This Article
iOS developers need to set up remote notifications and get Apple Push Notification service SSL sandbox certificates to test silent push locally. The certificates also need to be converted to .pem format.
Arinc Elhan's guide walks through enabling Background Modes capability, creating sandbox certificates on developer.apple.com, converting them to .pem format, and setting up cURL commands with the apns-topic App ID for testing.
You can create a waiting scheme in Xcode that launches without starting the app right away. This lets you attach debuggers to background processes and check that silent notifications work correctly when you send them via cURL from the terminal.