Flutterflow Firebase Notification
Flutterflow Firebase Notification for Wordpress
by BEEPIXL · github.com/beepixl/flutterflow-firebase-notifications
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/beepixl/flutterflow-firebase-notifications/archive/refs/heads/main.zipFlutterflow Firebase Notification for Woocommerce
WordPress plugin for:
- saving FlutterFlow app device tokens to user profile,
- sending Firebase Cloud Messaging (FCM) notifications on WooCommerce order events,
- manual test notification sending,
- failed notification logging.
Plugin Setup
- Activate the plugin in WordPress.
- Open
WP Admin -> Flutterflow Push. - Configure Firebase:
- Preferred: upload your Firebase service account JSON file.
- Optional fallback: manually fill
Project ID,Client Email, andPrivate Key.
- Save settings.
API Base
- Base route namespace:
/wp-json/flutterflow-push/v1
Example full URL (local):
http://your-site.test/wp-json/flutterflow-push/v1
Authentication
1) Save Device Token API
- Uses WooCommerce API credentials (
consumer_key,consumer_secret) +user_id. - Any existing WordPress
user_idcan be targeted when API key is valid.
2) Test Notification API
- Admin only (
manage_optionscapability).
1) Save Device Token
Save/update the user device token in user meta key flutterflow_device_token.
- Endpoint:
POST /wp-json/flutterflow-push/v1/token - Permission: valid WooCommerce API key with
writeorread_writepermission - Body:
user_id(int, required)firebase_token(string, required)consumer_key(string, required)consumer_secret(string, required)
cURL Example
curl -X POST "http://your-site.test/wp-json/flutterflow-push/v1/token" \
-H "Content-Type: application/json" \
-d '{
"user_id": 123,
"firebase_token": "YOUR_FCM_DEVICE_TOKEN",
"consumer_key": "ck_xxxxxxxxxxxxxxxxxxxxx",
"consumer_secret": "cs_xxxxxxxxxxxxxxxxxxxxx"
}'
Success Response
{
"success": true,
"message": "Firebase token saved.",
"user_id": 123
}
Error Response (validation)
{
"success": false,
"message": "Invalid user_id."
}
2) Send Test Notification (Admin)
Send a custom push to any token to verify FCM setup.
- Endpoint:
POST /wp-json/flutterflow-push/v1/test - Permission: admin user only
- Body:
device_token(string, required)title(string, required)message(string, required)
cURL Example
curl -X POST "http://your-site.test/wp-json/flutterflow-push/v1/test" \
-H "Content-Type: application/json" \
-H "Cookie: wordpress_logged_in=ADMIN_SESSION_COOKIE" \
-d '{
"device_token": "YOUR_FCM_DEVICE_TOKEN",
"title": "Test Notification",
"message": "Hello from Flutterflow Firebase Notifications plugin."
}'
Success Response
{
"success": true,
"response": {
"name": "projects/PROJECT_ID/messages/MESSAGE_ID"
}
}
Error Response
{
"success": false,
"error": "FCM settings are not configured."
}
WooCommerce Notification Triggers
The plugin automatically sends notifications to the customer token when:
- order is placed (
woocommerce_checkout_order_processed) - order status changes (
woocommerce_order_status_changed)
If customer has no saved token, failure is logged.
Failed Notification Logs
Failed sends are stored in table:
wp_flutterflow_push_failures(with your WP table prefix)
Available in admin:
WP Admin -> Flutterflow Push -> Recent Failed Notifications
Logged fields include:
user_id,order_id,device_tokenmessage_title,message_bodyhttp_status,error_code,error_messagepayload_json,created_at
Notes for FlutterFlow Integration
- Call token API after user login and after every token refresh.
- Re-send token whenever FCM token changes.
- Use one WooCommerce REST API key pair per app environment (dev/stage/prod).
- Use test API/admin test form first before enabling production order notifications.