{"id":31059228,"url":"https://github.com/salmanazamdev/rn-firebase-complete","last_synced_at":"2025-09-15T08:24:52.038Z","repository":{"id":311111860,"uuid":"1042485712","full_name":"salmanazamdev/rn-firebase-complete","owner":"salmanazamdev","description":"Complete React Native Firebase integration with Push Notifications \u0026 Analytics. Features modern UI, real-time testing, comprehensive event tracking, and production-ready code. Perfect starter template for Firebase-powered React Native apps.","archived":false,"fork":false,"pushed_at":"2025-08-25T11:37:47.000Z","size":673,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-05T00:46:37.233Z","etag":null,"topics":["analytics","android-development","fcm","fcm-messaging","fcm-notifications","fcm-push-notification","firebase","firebase-analytics","firebase-auth","google-analytics","mobile-development","notification","notifications","push-notification-api","push-notifications","react-native","react-native-cli","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salmanazamdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-22T05:08:55.000Z","updated_at":"2025-08-25T11:37:51.000Z","dependencies_parsed_at":"2025-08-25T08:08:48.866Z","dependency_job_id":"1d3afb31-f7e2-4a74-80e6-307a1853448b","html_url":"https://github.com/salmanazamdev/rn-firebase-complete","commit_stats":null,"previous_names":["salmanazamdev/rn_firebase_push_notifications","salmanazamdev/rn-firebase-complete"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/salmanazamdev/rn-firebase-complete","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmanazamdev%2Frn-firebase-complete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmanazamdev%2Frn-firebase-complete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmanazamdev%2Frn-firebase-complete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmanazamdev%2Frn-firebase-complete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salmanazamdev","download_url":"https://codeload.github.com/salmanazamdev/rn-firebase-complete/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salmanazamdev%2Frn-firebase-complete/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275227031,"owners_count":25427302,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","android-development","fcm","fcm-messaging","fcm-notifications","fcm-push-notification","firebase","firebase-analytics","firebase-auth","google-analytics","mobile-development","notification","notifications","push-notification-api","push-notifications","react-native","react-native-cli","typescript"],"created_at":"2025-09-15T08:24:49.968Z","updated_at":"2025-09-15T08:24:52.029Z","avatar_url":"https://github.com/salmanazamdev.png","language":"TypeScript","readme":"# 🔥 React Native Firebase Complete Integration\n\nA comprehensive React Native application demonstrating **Firebase Push Notifications** and **Firebase Analytics** integration with a beautiful, production-ready UI.\n\n## ✨ Features\n\n### 📱 Push Notifications\n- ✅ **Foreground Notifications** - Alert dialogs when app is active\n- ✅ **Background Notifications** - System notifications in notification bar\n- ✅ **Notification Channels** - Proper Android 8.0+ channel management\n- ✅ **FCM Token Management** - Easy token copying for testing\n- ✅ **Local Notifications** - Test notifications without server\n- ✅ **Notification History** - Track received notifications in-app\n\n### 📊 Analytics Integration\n- ✅ **Event Tracking** - Comprehensive user interaction analytics\n- ✅ **Screen Views** - Automatic screen tracking\n- ✅ **User Properties** - User segmentation support\n- ✅ **Custom Events** - Business-specific event logging\n- ✅ **Real-time Testing** - DebugView integration for live testing\n- ✅ **Error Tracking** - Analytics error monitoring\n\n### 🎨 UI/UX Features\n- ✅ **Modern Material Design** - Clean, professional interface\n- ✅ **Status Indicators** - Real-time feature status display\n- ✅ **Interactive Testing** - Built-in test buttons for all features\n- ✅ **Comprehensive Guides** - In-app testing instructions\n- ✅ **Responsive Layout** - Works on all Android screen sizes\n\n\u003c!-- ## 📸 Screenshots\n\n[Add your app screenshots here] --\u003e \n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- React Native development environment set up\n- Android Studio installed\n- Firebase project created\n- Physical Android device (recommended for push notifications)\n\n### Installation\n\n1. **Clone the repository**\n```bash\ngit clone https://github.com/salmanazamdev/rn-firebase-complete\ncd rn-firebase-complete\n```\n\n2. **Install dependencies**\n```bash\nnpm install\n# or\nyarn install\n```\n\n3. **Install required Firebase packages**\n```bash\nnpm install @react-native-firebase/app\nnpm install @react-native-firebase/messaging\nnpm install @react-native-firebase/analytics\nnpm install react-native-push-notification\n```\n\n4. **Firebase Setup**\n   - Create a Firebase project at [Firebase Console](https://console.firebase.google.com/)\n   - Add Android app to your project\n   - Download `google-services.json`\n   - Place it in `android/app/` directory\n   - Enable **Cloud Messaging** and **Analytics** in Firebase Console\n\n5. **Android Configuration**\n\nAdd to `android/app/build.gradle`:\n```gradle\ndependencies {\n    implementation 'com.google.firebase:firebase-messaging:23.1.0'\n    implementation 'com.google.firebase:firebase-analytics:21.5.0'\n}\n\napply plugin: 'com.google.gms.google-services'\n```\n\nAdd to `android/build.gradle`:\n```gradle\nbuildscript {\n    dependencies {\n        classpath 'com.google.gms:google-services:4.4.0'\n    }\n}\n```\n\n6. **Run the application**\n```bash\nnpx react-native run-android\n```\n\n## 🧪 Testing\n\n### Push Notifications Testing\n\n1. **Get FCM Token**\n   - Launch the app\n   - Tap \"Copy Token to Console\"\n   - Copy the token from terminal\n\n2. **Send Test Notification**\n   - Go to [Firebase Console](https://console.firebase.google.com/) → Cloud Messaging\n   - Click \"Send your first message\"\n   - Enter title and body\n   - Click \"Test on device\"\n   - Paste your FCM token\n   - Send!\n\n3. **Test Different States**\n   - **Foreground**: Keep app open → Should show alert\n   - **Background**: Press home button → Should show in notification bar\n   - **Closed**: Close app completely → Should show in notification bar\n\n### Analytics Testing\n\n1. **Enable Debug Mode**\n```bash\nadb shell setprop debug.firebase.analytics.app com.pushnotificationdemo\n```\n\n2. **Real-time Testing**\n   - Go to Firebase Console → Analytics → DebugView\n   - Tap \"Test Analytics Event\" in app\n   - See events appear in real-time!\n\n3. **View Reports**\n   - Firebase Console → Analytics → Events\n   - Firebase Console → Analytics → Dashboard\n   - Data appears within 24-48 hours for reports\n\n## 📋 Firebase Console Setup\n\n### 1. Enable Cloud Messaging\n- Firebase Console → Project Settings → Cloud Messaging\n- Note your Server Key for API testing\n\n### 2. Enable Analytics\n- Firebase Console → Analytics → Dashboard\n- Click \"Enable Analytics\" if not enabled\n- Link to Google Analytics account\n\n### 3. Verify Configuration\n- Check that `google-services.json` package name matches your app\n- Ensure both services are enabled in your Firebase project\n\n## 🛠️ Customization\n\n### Adding Custom Events\n```typescript\nimport analytics from '@react-native-firebase/analytics';\n\n// Log custom event\nawait analytics().logEvent('custom_event_name', {\n  parameter_1: 'value1',\n  parameter_2: 123,\n  timestamp: Date.now(),\n});\n```\n\n### Adding User Properties\n```typescript\n// Set user properties\nawait analytics().setUserProperty('user_type', 'premium');\nawait analytics().setUserProperty('preferred_category', 'tech');\n```\n\n### Custom Notification Channels\n```typescript\nPushNotification.createChannel({\n  channelId: \"custom_channel\",\n  channelName: \"Custom Notifications\",\n  importance: 5,\n  vibrate: true,\n});\n```\n\n## 📊 Analytics Events Tracked\n\nThe app automatically tracks:\n\n- `app_open` - App launches\n- `screen_view` - Screen transitions\n- `notification_received` - Push notifications received\n- `notification_opened_app` - App opened via notification\n- `fcm_token_received` - FCM token generation\n- `test_local_notification_sent` - Test notification sent\n- `analytics_initialized` - Analytics setup complete\n- `notifications_cleared` - Notification history cleared\n\n## 🐛 Troubleshooting\n\n### Common Issues\n\n**Notifications not appearing?**\n- Check device notification permissions\n- Disable battery optimization for your app\n- Ensure `google-services.json` is in correct location\n- Verify notification channel setup\n\n**Analytics not working?**\n- Check if Analytics is enabled in Firebase Console\n- Verify `google-services.json` configuration\n- Use DebugView for real-time testing\n- Events may take 24-48 hours to appear in reports\n\n**Build errors?**\n```bash\ncd android \u0026\u0026 ./gradlew clean \u0026\u0026 cd .. \u0026\u0026 npx react-native run-android\n```\n\n### Debug Commands\n```bash\n# Check app logs\nadb logcat | grep -i \"firebase\"\n\n# Enable analytics debug mode\nadb shell setprop debug.firebase.analytics.app YOUR_PACKAGE_NAME\n\n# Clear app data\nadb shell pm clear YOUR_PACKAGE_NAME\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n## 🙏 Acknowledgments\n\n- [React Native Firebase](https://rnfirebase.io/) for excellent Firebase integration\n- [Firebase](https://firebase.google.com/) for powerful backend services\n- [React Native Push Notification](https://github.com/zo0r/react-native-push-notification) for local notifications\n\n## 📞 Support\n\nIf you have any questions or need help:\n\n1. Check the [Issues](https://github.com/salmanazamdev/rn-firebase-complete/issues) page\n2. Create a new issue with detailed information\n3. [LinkedIn](https://www.linkedin.com/in/salmanazamdev?)\n\n---\n\n⭐ **Star this repo** if it helped you! It motivates me to create more awesome projects.\n\n## 🔄 Recent Updates\n\n- ✅ Added comprehensive Firebase Analytics integration\n- ✅ Enhanced UI with real-time status indicators\n- ✅ Added in-app testing tools for both features\n- ✅ Improved error handling and logging\n- ✅ Added user properties and custom event tracking\n- ✅ Added detailed testing guides and troubleshooting","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalmanazamdev%2Frn-firebase-complete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalmanazamdev%2Frn-firebase-complete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalmanazamdev%2Frn-firebase-complete/lists"}