{"id":44268909,"url":"https://github.com/ker0x/fcm","last_synced_at":"2026-02-10T18:42:03.058Z","repository":{"id":48336177,"uuid":"70288284","full_name":"ker0x/fcm","owner":"ker0x","description":"📨 A PHP library to send push notification with Firebase Cloud Messaging","archived":false,"fork":false,"pushed_at":"2024-02-15T09:42:26.000Z","size":192,"stargazers_count":18,"open_issues_count":1,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-11T04:33:37.389Z","etag":null,"topics":["fcm","firebase","firebase-cloud-messaging","messaging","notifications","php","php-libray","push-notifications"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ker0x.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2016-10-07T22:49:25.000Z","updated_at":"2024-10-04T11:39:25.000Z","dependencies_parsed_at":"2024-02-15T10:27:35.999Z","dependency_job_id":"f9a7c0ae-c3e7-4cd9-bb6f-39c6249fb966","html_url":"https://github.com/ker0x/fcm","commit_stats":{"total_commits":40,"total_committers":5,"mean_commits":8.0,"dds":"0.17500000000000004","last_synced_commit":"70ed932432cb7cea9ccb9e312479a82a449060e7"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/ker0x/fcm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ker0x%2Ffcm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ker0x%2Ffcm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ker0x%2Ffcm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ker0x%2Ffcm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ker0x","download_url":"https://codeload.github.com/ker0x/fcm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ker0x%2Ffcm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29311367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-10T17:48:59.043Z","status":"ssl_error","status_checked_at":"2026-02-10T17:45:37.240Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["fcm","firebase","firebase-cloud-messaging","messaging","notifications","php","php-libray","push-notifications"],"created_at":"2026-02-10T18:42:02.115Z","updated_at":"2026-02-10T18:42:03.035Z","avatar_url":"https://github.com/ker0x.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Tests](https://img.shields.io/github/actions/workflow/status/ker0x/fcm/ci.yml?label=tests\u0026style=for-the-badge)](https://github.com/ker0x/fcm/actions/workflows/ci.yml)\n[![Coverage](https://img.shields.io/codecov/c/gh/ker0x/fcm?style=for-the-badge)](https://codecov.io/gh/ker0x/fcm/)\n![PHP Version](https://img.shields.io/badge/php-\u003e=8.2-4f5b93.svg?style=for-the-badge)\n[![Download](https://img.shields.io/packagist/dt/kerox/fcm.svg?style=for-the-badge)](https://packagist.org/packages/kerox/fcm)\n[![Packagist](https://img.shields.io/packagist/v/kerox/fcm.svg?style=for-the-badge)](https://packagist.org/packages/kerox/fcm)\n[![License](https://img.shields.io/github/license/talesfromadev/flowbite-bundle?style=for-the-badge)](https://github.com/ker0x/fcm/blob/main/LICENSE)\n\n# Fcm\n\nA PHP library to send push notification with [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/)\n\n\u003e [!NOTE]\n\u003e Version `3.x` of this library is a full rewrite using [PSR-18 HTTP Client](https://www.php-fig.org/psr/psr-18/) interface, \n\u003e which means that **no** HTTP Client, like [Guzzle](https://github.com/guzzle/guzzle) or [httplug](https://github.com/php-http/httplug), \n\u003e are provided within. If you already have one in your project, the package will **automatically discover it** and use it.\n\u003e Otherwise You will need to require one separately.\n\n\u003e [!WARNING]\n\u003e Version `3.2` introduce a BC break.\n\u003e The signature of the `__construct()` method of the `Kerox\\Fcm\\Model\\Message` class has changed, with the `$notification` parameter becoming the third argument and being optional.\n\n## Installation\n\nYou can install Fcm using Composer:\n\n```\ncomposer require kerox/fcm\n```\n\nYou will then need to:\n* run `composer install` to get these dependencies added to your vendor directory\n* add the autoloader to your application with this line: `require('vendor/autoload.php');`\n\n## Basic usage\n\n```php\nuse Kerox\\Fcm\\Fcm;\nuse Kerox\\Fcm\\Model\\Message;\nuse Kerox\\Fcm\\Model\\Notification\\Notification;\nuse Kerox\\Fcm\\Model\\Target;\n\n$fcm = new Fcm('\u003coauth_token\u003e', '\u003cproject_id\u003e');\n\n// Create the message\n$message = new Message(\n    target: new Token('TopicA'),\n    data: [\n        'story_id' =\u003e 'story_12345',\n    ],\n    notification: new Notification(\n        title: 'Hello World',\n        body: 'My awesome Hello World!'\n    ),\n)\n\n// Send the message and get the response\n$response = $fcm-\u003esend()-\u003emessage($message);\n```\n\n## Documentation\n\nThe documentation is available [here](https://github.com/ker0x/fcm/wiki)\n\n## Testing\n\nTo live test the package, you must first generate an OAuth token.\nGo to https://developers.google.com/oauthplayground/ and select **Firebase Cloud Messaging API v1** from the list of APIs.\nThen select https://www.googleapis.com/auth/firebase.messaging and generate the OAuth token.\nFinally, define an environment variable named `FCM_OAUTH_TOKEN` and assign it the value of the access token.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fker0x%2Ffcm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fker0x%2Ffcm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fker0x%2Ffcm/lists"}