Topic-Based Push Notifications for Firebase
Topic-Based Push Notifications for Firebase enables you to send push notifications from your WordPress admin panel directly to Android mobile applications using Firebase Cloud Messaging (FCM). Perfect for apps that need to notify users about new content, updates, or important announcements.
Key Features
- Topic-Based Targeting: Send notifications to specific user groups by topic subscription
- Rich Notifications: Support for images, custom links, and detailed messaging
- Complete Analytics: Track delivery rates, engagement, and notification performance
- Engagement Tracking: Monitor when users open notifications with detailed metrics
- History Management: View all sent notifications with filtering and search capabilities
- Modern Interface: Clean, responsive admin interface that works on all devices
- Secure Implementation: Built with WordPress security best practices
How It Works
- Setup: Upload your Firebase service account JSON file and configure topics
- Create: Compose notifications with title, message, optional image, and link
- Target: Select which topics (user groups) should receive the notification
- Send: Deliver notifications instantly to all subscribed Android devices
- Track: Monitor delivery success rates and user engagement in real-time
Perfect For
- News and blog websites with mobile apps
- E-commerce stores with Android applications
- Educational platforms with student mobile apps
- Community websites with member applications
- Any WordPress site with an Android companion app
What You Need
- Firebase project with FCM enabled
- Service account JSON file from Firebase Console
- Android app configured to receive FCM notifications (topic based). This version doesn’t handle token based notifications.
- WordPress 5.0+ and PHP 7.4+
External Services
This plugin connects to Google’s Firebase services to send push notifications to mobile applications. External service connections are required for the plugin’s core functionality.
Google OAuth API (oauth2.googleapis.com) * Purpose: Authentication with Firebase Cloud Messaging service * Data sent: Service account credentials (from your uploaded JSON file), authentication tokens * When: Every time notifications are sent (to obtain access tokens) * Terms of Service: https://developers.google.com/terms * Privacy Policy: https://policies.google.com/privacy
Firebase Cloud Messaging API (fcm.googleapis.com) * Purpose: Sending push notifications to Android mobile applications * Data sent: Notification content (title, message, image URLs, links), target topics, FCM project ID * When: When you send notifications through the plugin interface * Terms of Service: https://firebase.google.com/terms * Privacy Policy: https://policies.google.com/privacy
Privacy & Data
This plugin processes notification data locally on your WordPress installation. Notifications are sent directly to Google’s Firebase Cloud Messaging service.
No user data is collected or sent to services other than Google/Firebase for notification delivery. Your Firebase service account credentials are stored securely on your server.
Developers
The plugin includes hooks and filters for developers to extend functionality:
tbpn_before_send_notification— Filter notification data before sendingtbpn_after_send_notification— Action after notification is senttbpn_notification_response— Filter FCM response data- REST API endpoint for mobile apps to report engagement
Technical Details
System Requirements
- WordPress 5.0 or higher
- PHP 7.4 or higher
- MySQL 5.6 or MariaDB 10.0
- SSL certificate (recommended for production)
File Permissions
The plugin creates a secure upload directory for Firebase service account files. Ensure your WordPress uploads directory is writable.
Database Tables
The plugin creates two tables:
* wp_tbpn_notifications — Stores notification history and analytics
* wp_tbpn_engagements — Tracks user engagement with notifications
REST API Endpoints
POST /wp-json/mn/v1/engage— Report notification engagement (for mobile apps)
Hooks for Developers
Actions:
* tbpn_notification_sent — Triggered after notification is sent
* tbpn_notification_failed — Triggered when notification sending fails
* tbpn_engagement_recorded — Triggered when engagement is recorded
Filters:
* tbpn_notification_data — Filter notification data before sending
* tbpn_topics_list — Filter available topics
* tbpn_max_notifications_per_hour — Filter rate limiting
Security Features
- Nonce verification for all forms
- Capability checks for admin actions
- SQL injection prevention with prepared statements
- XSS prevention with proper output escaping
- Secure file upload handling
- Rate limiting for notification sending
Support
For support, feature requests, or bug reports, please use the WordPress.org support forums.
For documentation and updates, visit the plugin homepage.
Contributing
This plugin is open source. Contributions, bug reports, and feature requests are welcome on the plugin’s development repository.