firebase_fcm_token 1.1.0
firebase_fcm_token: ^1.1.0 copied to clipboard
A lightweight Flutter package for app status control with server integration and admin panel. Control your app remotely, show white screen when disabled, and manage everything through admin panel.
🎯 Firebase FCM Token - App Status Controller #
A lightweight Flutter package for remote app status control with server integration and admin panel. Perfect for managing app availability, showing maintenance screens, and controlling user access remotely.
✨ Features #
- 🎛️ Remote App Control - Enable/disable your app from admin panel
- 🖥️ Admin Panel - Beautiful web interface for app management
- 📱 White Screen Mode - Show blank screen when app is disabled
- 🔧 Easy Integration - Just one line of code to implement
- 🚀 Production Ready - Includes deployment guides and security
- 📊 Detailed Logging - Flutter console error messages when disabled
- 🌐 Server Included - Complete PHP backend with MySQL
🚀 Quick Start #
1. Add to pubspec.yaml #
dependencies:
firebase_fcm_token: ^1.1.0
2. Initialize in your app #
import 'package:firebase_fcm_token/firebase_fcm_token.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize with just your app name
await FirebaseFcmToken().initialize(
appName: 'my_awesome_app',
);
runApp(MyApp());
}
3. Wrap your app with status widget #
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FirebaseFcmToken().buildAppStatusWidget(
child: MaterialApp(
title: 'My App',
home: HomePage(),
),
);
}
}
That's it! 🎉 Your app now supports remote control.
📋 What happens when app is disabled? #
When your app is disabled from the admin panel:
- White Screen - Users see a blank white screen
- Console Errors - Detailed error messages in Flutter console
- No Functionality - All app features are blocked
- Admin Control - Only admin can re-enable the app
🖥️ Admin Panel #
Access your admin panel at: https://yourdomain.com/server/admin/
Features:
- 📊 Real-time app statistics
- 📱 Enable/disable apps with one click
- 👥 User and device tracking
- 📈 Usage analytics
- 🔍 Detailed logs and monitoring
Default Login:
- Password:
admin123(change this!)
🛠️ Server Setup #
-
Upload Server Files
# Upload the server/ directory to your hosting # Example: yourdomain.com/server/ -
Create MySQL Database
CREATE DATABASE firebase_fcm_db; -
Configure Database
// server/config.php define('DB_HOST', 'localhost'); define('DB_NAME', 'firebase_fcm_db'); define('DB_USER', 'your_username'); define('DB_PASS', 'your_password'); -
Import Database Schema
- Use PHPMyAdmin to import
server/database.sql
- Use PHPMyAdmin to import
📖 Documentation #
- 📘 Setup Guide - Complete installation instructions
- 🚀 Production Guide - Deploy to production securely
- 💡 Examples - Code examples and use cases
🔧 API Methods #
final controller = FirebaseFcmToken();
// Check if app is enabled
bool isEnabled = controller.isAppEnabled;
// Refresh app status from server
await controller.refreshAppStatus();
// Build status widget (shows white screen if disabled)
Widget statusWidget = controller.buildAppStatusWidget(
child: YourApp(),
);
🌟 Use Cases #
- Maintenance Mode - Disable app during updates
- Emergency Stop - Instantly disable problematic versions
- Gradual Rollout - Control which users see new features
- A/B Testing - Enable features for specific user groups
- Regional Control - Disable app in specific regions
🔒 Security Features #
- ✅ Rate limiting on API calls
- ✅ Admin panel authentication
- ✅ SQL injection protection
- ✅ HTTPS enforcement
- ✅ IP whitelisting support
📱 Supported Platforms #
- ✅ Android - Full support
- ✅ iOS - Full support
- ✅ Web - Full support
- ✅ Desktop - Full support
🤝 Contributing #
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
📄 License #
This project is licensed under the MIT License - see the LICENSE file for details.
🆘 Support #
- 📧 Issues: GitHub Issues
- 📖 Documentation: README.md
- 💬 Discussions: GitHub Discussions
⭐ Show Your Support #
If this package helped you, please ⭐ star the repo and share it with other developers!
Made with ❤️ by the Firebase FCM Token team