PHPackages                             coder966/fcm-simple - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. coder966/fcm-simple

ActiveLibrary[API Development](/categories/api)

coder966/fcm-simple
===================

PHP library for Firebase Cloud Messaging

v4.0.0(7y ago)141.2k4[2 issues](https://github.com/coder966/fcm-simple/issues)Apache-2.0PHPPHP &gt;=5.6.0

Since Jul 20Pushed 7y ago5 watchersCompare

[ Source](https://github.com/coder966/fcm-simple)[ Packagist](https://packagist.org/packages/coder966/fcm-simple)[ Docs](https://github.com/coder966/fcm-simple)[ RSS](/packages/coder966-fcm-simple/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (12)Used By (0)

FCMSimple
=========

[](#fcmsimple)

[![Latest Stable Version](https://camo.githubusercontent.com/8781c96de1fa8fee4ca5cbc4af05116016a5634abb25f4e419588c343ed3c42f/68747470733a2f2f706f7365722e707567782e6f72672f636f6465723936362f66636d2d73696d706c652f762f737461626c65)](https://packagist.org/packages/coder966/fcm-simple)[![License](https://camo.githubusercontent.com/62304712dfec918bfa11685ba3d231e1287f9f2e6b9db74a7c3f59de0c32649e/68747470733a2f2f706f7365722e707567782e6f72672f636f6465723936362f66636d2d73696d706c652f6c6963656e7365)](https://packagist.org/packages/coder966/fcm-simple)

A PHP library to send messages to devices registered through Firebase Cloud Messaging (FCM).

Features:

- Lightweight &amp; simple
- Zero dependencies
- Implemented using cURL
- Support sending to topics and tokens
- Support various message options like `CollapseKey`, `Priority`, `TimeToLive` and more
- Provides you with the tokens you should update/remove from your database

Usage
-----

[](#usage)

For further details, see the [Wiki](https://github.com/coder966/FCMSimple/blob/master/Wiki.md "Wiki")

### Installation

[](#installation)

You need PHP &gt;= 5.4

```
$ composer require coder966/fcm-simple

```

### PHP Server

[](#php-server)

```
require 'vendor/autoload.php';

use FCMSimple\Client;
use FCMSimple\Message;

// create the client
$client = new Client("YOUR_SERVER_KEY");

// create the message
$msg = new Message();
$msg->put("key1", "value1");
$msg->put("key2", "value2");

// send the message to a specific topic
$client->sendToTopic($msg, "my_topic");

// or you can send to specific devices using their registration tokens
// so first prepare your array of tokens, typically retrieve from DB
$tokens = [
    "token_1",
    "token_2",
    "token_3"
];
// and send
$client->sendToTokens($msg, $tokens);
```

### Android Client

[](#android-client)

In the service that extends `FirebaseMessagingService`, in method `onMessageReceived`, use:

```
Map msg = remoteMessage.getData();
String value1 = msg.get("key1");
String value2 = msg.get("key2");
```

License
-------

[](#license)

```
Copyright 2016 Khalid H. Alharisi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

```

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~115 days

Recently: every ~92 days

Total

10

Last Release

2597d ago

Major Versions

v1.2.1 → v2.0.02016-11-12

v2.0.0 → v3.0.02017-06-12

v3.4.0 → v4.0.02019-05-21

PHP version history (3 changes)v1.2PHP &gt;=5.3.0

v3.0.0PHP &gt;=5.4.0

v3.2.0PHP &gt;=5.6.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11215861?v=4)[Khalid](/maintainers/coder966)[@coder966](https://github.com/coder966)

---

Top Contributors

[![coder966](https://avatars.githubusercontent.com/u/11215861?v=4)](https://github.com/coder966 "coder966 (119 commits)")

---

Tags

fcmfcm-httpfirebasefirebase-cloud-messaginggcmphpphpcloudfirebaseFCMmessagingandroidios

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/coder966-fcm-simple/health.svg)

```
[![Health](https://phpackages.com/badges/coder966-fcm-simple/health.svg)](https://phpackages.com/packages/coder966-fcm-simple)
```

###  Alternatives

[redjanym/php-firebase-cloud-messaging

PHP SDK for Firebase Cloud Messaging from Google

37858.2k2](/packages/redjanym-php-firebase-cloud-messaging)[paragraph1/php-fcm

PHP application server for google firebase cloud messaging (FCM)

1961.3M11](/packages/paragraph1-php-fcm)[redjanym/fcm-bundle

A Symfony Bundle for projects to send notifications in mobile devices through Firebase Cloud Messaging HTTP V1 API

43455.6k](/packages/redjanym-fcm-bundle)[kedniko/firebase-cloud-messaging-http-v1-php

Firebase cloud messaging http v1 php

125.5k](/packages/kedniko-firebase-cloud-messaging-http-v1-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
