Push Notifications
Push notifications use OneSignal for delivery. The SDK handles initialization, permission requests, device registration, and notification interaction tracking automatically.Setup
- Create a OneSignal app and get your OneSignal App ID
- Configure it in your Stackfront dashboard
- The SDK fetches the OneSignal App ID from remote config and initializes automatically
How It Works
WhenStackfrontProvider initializes:
- OneSignal is initialized with the app ID from remote config
- Permission is requested automatically via the
usePushhook - Device is registered with the Stackfront API (platform, app version, device model, OS version)
- Notification clicks are tracked — when a user taps a notification containing a
campaign_id, an open event is sent to the API
Hook API
Permission Handling
Customer Linking
When a customer logs in, the SDK automatically links their OneSignal player ID to their customer ID. This enables targeted notifications:Notification Click Tracking
When a user taps a push notification with acampaign_id in its additionalData, a click event is sent to the Stackfront API:
Service API
OneSignal Integration
If you need to use OneSignal APIs directly outside the SDK, importOneSignal: