Question
I'm developing a TV Web application and need to implement push notifications. I've successfully registered with the Push Service and obtained a regID (starting with "05"), but despite sending notifications via Postman, my app isn't receiving them.
Key issues:
- Push notifications aren't being received despite proper registration
- The notification callback function isn't executing
- Need to know if Firebase Cloud Messaging is a viable alternative
- Need to display notifications when the app is in background
Additional details:
- Using Korean API despite being in Europe
- Included appID, appSecret, and Content-Type in headers
- Tried modifying notificationCallback parameters without success
- Explored Firebase Cloud Messaging but couldn't get ServiceWorker to work
Answer
Problem Understanding
The user is facing issues with push notification implementation in a Tizen TV Web application, specifically with:
- Notification delivery failure
- Callback function execution
- Alternative notification methods
- Background notification display
Solution Methods
-
Push Notification Configuration
- Ensure target device runs Tizen 3.0 or higher
- Add both 'internet' and 'push' privileges in config.xml
- Verify all prerequisites from the official documentation
-
Service Worker Check
- Confirm Service Worker support using:
if ('serviceWorker' in navigator) { console.log('Service worker is Supported'); } else { console.log('Service worker is not Supported'); }
- Confirm Service Worker support using:
-
Notification Handling
- Review the notification handling documentation for:
- Application running state
- Application background state
- Review the notification handling documentation for:
Code Examples
For checking Service Worker support:
if ('serviceWorker' in navigator) {
console.log('Service worker is Supported');
} else {
console.log('Service worker is not Supported');
}
Additional Tips
- Double-check all API keys and registration details
- Verify network connectivity and server configurations
- Consider testing with different notification payloads
- Review the updated documentation on Samsung Tizen OS for current best practices