Complete setup guide: See
/docs/integrations/OneSignal.md in the projectWhat is OneSignal?
Push Notifications
Send push notifications to engage users
Rich Notifications
Images, buttons, badges, and custom sounds
Analytics
Confirmed delivery and engagement tracking
Segmentation
Target users by behavior, tags, or segments
Optional Integration: OneSignal is completely optional. Your app works perfectly fine without it. Simply don’t configure the App ID if you don’t need push notifications.
Features Included
- ✅ Push notifications via OneSignal SDK
- ✅ Rich notifications with images, buttons, and badges
- ✅ Confirmed delivery analytics
- ✅ User segmentation support
- ✅ In-app messaging capability
- ✅ Notification Service Extension pre-configured
- ✅ Graceful degradation (works without configuration)
Prerequisites
- OneSignal account (free tier available)
- Apple Developer account (for push certificate)
- App ID with Push Notifications capability enabled
Setup Guide
OneSignal provides excellent, regularly-updated documentation for iOS SDK setup. We recommend following their official guide:OneSignal iOS SDK Setup
Follow OneSignal’s comprehensive step-by-step guide for iOS integration
Quick Overview
1
Create OneSignal Account
Go to OneSignal and create a free account. The free tier includes unlimited push notifications for up to 10,000 subscribers.
2
Follow OneSignal's iOS Setup
Their guide covers:
- Adding Push Notifications capability
- Configuring Background Modes
- Setting up App Groups
- Adding Notification Service Extension
- Installing the SDK
3
Add App ID to Config
After OneSignal setup, add your App ID to
Config/Secrets.xcconfig:4
Run Update Config Script
Generate the Swift configuration:
5
Build and Test
Build and run on a real device (push notifications don’t work in simulator):
- Run the app
- Accept push notification permission
- Send a test notification from OneSignal dashboard
- Verify notification appears on device
How It Works
Automatic Integration
The boilerplate automatically initializes OneSignal when the App ID is configured:Graceful Degradation
If OneSignal is not configured:- App launches normally
- No SDK initialization
- No errors or crashes
- Push notification code paths are skipped
Removing OneSignal
If you don’t need push notifications:- Leave ONESIGNAL_APP_ID empty in
Secrets.xcconfig - The SDK won’t initialize
- No push notification code will run
- Remove OneSignal package from Swift Package Manager
- Delete the Notification Service Extension target
- Remove OneSignal references from code
- See
/docs/integrations/OneSignal.mdfor complete removal guide
Troubleshooting
Notifications not received
Notifications not received
- Test on a real device (not simulator)
- Verify APNs certificate/key is correct in OneSignal
- Check Push Notifications capability is enabled in Xcode
- Ensure user accepted notification permission
- Check OneSignal dashboard for delivery status
Rich notifications not showing images
Rich notifications not showing images
- Verify Notification Service Extension is in your target
- Check image URL is HTTPS
- Ensure image is under 10MB
- Test with a simple image first
OneSignal not initializing
OneSignal not initializing
- Verify ONESIGNAL_APP_ID is set in Secrets.xcconfig
- Run
bash scripts/update-config.sh - Check Configuration.swift has the App ID
- Clean and rebuild (⌘⇧K then ⌘B)
Cost
OneSignal Free Tier:- ✅ Unlimited push notifications
- ✅ Up to 10,000 subscribers
- ✅ Basic analytics
- ✅ Enough for most indie apps
- More subscribers
- Advanced analytics
- A/B testing
- Priority support
Related Guides
OneSignal Official Docs
Comprehensive iOS SDK setup guide
Supabase Setup
Backend configuration
Crashlytics Setup
Another optional integration
Deployment
Ship to App Store
Need Help?
- 📖 Check the troubleshooting section above
- 📚 See
/docs/integrations/OneSignal.mdin your project - 💬 Create an issue
- 🔍 Search OneSignal docs
