{"id":26094128,"url":"https://github.com/abdullahali2005/push_notifications","last_synced_at":"2026-04-09T16:16:47.908Z","repository":{"id":281383288,"uuid":"945111051","full_name":"AbdullahAli2005/Push_Notifications","owner":"AbdullahAli2005","description":"A Flutter app integrating Firebase Cloud Messaging (FCM) for push notifications with foreground and background support","archived":false,"fork":false,"pushed_at":"2025-03-08T17:27:50.000Z","size":248,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T18:25:54.781Z","etag":null,"topics":["dart","firebase","firebase-cloud-messaging","flutter","push-notifications"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/AbdullahAli2005.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}},"created_at":"2025-03-08T17:25:37.000Z","updated_at":"2025-03-08T17:30:32.000Z","dependencies_parsed_at":"2025-03-08T18:36:51.897Z","dependency_job_id":null,"html_url":"https://github.com/AbdullahAli2005/Push_Notifications","commit_stats":null,"previous_names":["abdullahali2005/notifications"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdullahAli2005%2FPush_Notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdullahAli2005%2FPush_Notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdullahAli2005%2FPush_Notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AbdullahAli2005%2FPush_Notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AbdullahAli2005","download_url":"https://codeload.github.com/AbdullahAli2005/Push_Notifications/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242692342,"owners_count":20170228,"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","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":["dart","firebase","firebase-cloud-messaging","flutter","push-notifications"],"created_at":"2025-03-09T12:49:52.055Z","updated_at":"2026-04-09T16:16:47.871Z","avatar_url":"https://github.com/AbdullahAli2005.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flutter Push Notifications App\n\n## 📌 Overview\nThis Flutter application integrates **Firebase Cloud Messaging (FCM)** to send and receive push notifications. The app supports both foreground and background notifications using **flutter_local_notifications**.\n\n## 🚀 Features\n- 🔔 Receive push notifications via Firebase Cloud Messaging (FCM)\n- 🌐 Works in **foreground**, **background**, and **terminated** states\n- 📌 Displays local notifications using **flutter_local_notifications** when app is in the foreground\n- 🔗 Fetches and prints **FCM Token** for debugging\n\n---\n\n## 📂 Project Structure\n```\n📦 notifications_app\n ┣ 📂 lib\n ┃ ┣ 📜 main.dart\n ┃ ┣ 📂 api\n ┃ ┃ ┣ 📜 firebase_api.dart\n ┃ ┣ 📂 pages\n ┃ ┃ ┣ 📜 homepage.dart\n ┣ 📜 pubspec.yaml\n ┣ 📜 README.md\n```\n\n---\n\n## 🛠️ Installation\n\n### 1️⃣ **Clone the Repository**\n```sh\ngit clone https://github.com/your-repo/flutter-push-notifications.git\ncd flutter-push-notifications\n```\n\n### 2️⃣ **Install Dependencies**\n```sh\nflutter pub get\n```\n\n### 3️⃣ **Setup Firebase**\n1. Go to [Firebase Console](https://console.firebase.google.com/).\n2. Create a new project or select an existing one.\n3. Add an **Android** and/or **iOS** app.\n4. Download the `google-services.json` file and place it inside `android/app/`.\n5. Enable **Cloud Messaging** in Firebase settings.\n\n### 4️⃣ **Run the App**\n```sh\nflutter run\n```\n\n---\n\n## 🔧 Configuration\n\n### **Android Setup**\n- Ensure you have **Google Play Services** enabled.\n- Update `AndroidManifest.xml` with necessary permissions:\n```xml\n\u003cuses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/\u003e\n\u003cuses-permission android:name=\"android.permission.FOREGROUND_SERVICE\"/\u003e\n```\n\n### **iOS Setup**\n- Add the following permissions to `ios/Runner/Info.plist`:\n```xml\n\u003ckey\u003eNSAppTransportSecurity\u003c/key\u003e\n\u003cdict\u003e\n    \u003ckey\u003eNSAllowsArbitraryLoads\u003c/key\u003e\n    \u003ctrue/\u003e\n\u003c/dict\u003e\n\u003ckey\u003eFirebaseMessagingAutoInitEnabled\u003c/key\u003e\n\u003cfalse/\u003e\n```\n- Run this command in the iOS folder:\n```sh\npod install\n```\n\n---\n\n## 🔥 Usage\n\n### **1️⃣ Get FCM Token**\nWhen you run the app, the FCM Token will be printed in the console:\n```\nTOKEN: xxxxxxxx:yyyyyy:zzzzzz\n```\nUse this token to send notifications via Firebase or Postman.\n\n### **2️⃣ Sending Notifications via Firebase Console**\n1. Go to **Firebase Console** → **Cloud Messaging**\n2. Click **Send your first message**\n3. Enter a **title** and **message**\n4. Select **Send to a test device** and enter your FCM Token\n5. Click **Send Message**\n\n### **3️⃣ Handle Foreground Notifications**\nBy default, Firebase does not show notifications in the foreground. This app uses `flutter_local_notifications` to manually display them.\n\n---\n\n## 🎯 Troubleshooting\n\n### **Notifications Not Showing in Foreground?**\nMake sure you have `flutter_local_notifications` configured properly:\n```sh\nflutter pub add flutter_local_notifications\n```\n\n### **FCM Token Not Generating?**\n- Ensure Firebase is properly set up and `google-services.json` is added.\n- Try `flutter clean` and re-run the app.\n\n---\n\n## 🤝 Contributing\n1. Fork the repository.\n2. Create a new branch (`feature-branch`).\n3. Commit your changes.\n4. Push to your fork and submit a PR.\n\n---\n\n## 📩 Contact\nFor any queries, feel free to reach out:\n- **Email:** your.smabd7409@gmail.com\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdullahali2005%2Fpush_notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdullahali2005%2Fpush_notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdullahali2005%2Fpush_notifications/lists"}