PHPackages                             longdahai/fcm\_game - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. longdahai/fcm\_game

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

longdahai/fcm\_game
===================

fcm package for game

3.0(5y ago)07MITPHPPHP &gt;=7.1

Since Apr 1Pushed 5y agoCompare

[ Source](https://github.com/longdahai/fcm_game)[ Packagist](https://packagist.org/packages/longdahai/fcm_game)[ RSS](/packages/longdahai-fcm-game/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

FCM 网络游戏防沉迷实名认证系统包
==================

[](#fcm-网络游戏防沉迷实名认证系统包)

[![Build Status](https://camo.githubusercontent.com/51fd96600876b253924ba70c437ae57bd3742e1225328d4760c0a78700c068b0/68747470733a2f2f7472617669732d63692e6f72672f6368696e6177696c6f6e2f66636d5f67616d652e7376673f6272616e63683d6d61696e)](https://travis-ci.org/chinawilon/fcm_game)[![codecov](https://camo.githubusercontent.com/a6960fb48143f3098a1ce947d6af2af3157ee3f61d62d8e0b2b514fecc4e193a/68747470733a2f2f636f6465636f762e696f2f67682f6368696e6177696c6f6e2f66636d5f67616d652f6272616e63682f6d61696e2f67726170682f62616467652e7376673f746f6b656e3d3937544f767669575548)](https://codecov.io/gh/chinawilon/fcm_game)[![Supported PHP versions: =7.1+](https://camo.githubusercontent.com/31a9e41b61e055e51b957a206ea9e9f6356af2bce8ac24321b2ad6d89e3aab64/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e312b2d626c75652e737667)](https://camo.githubusercontent.com/31a9e41b61e055e51b957a206ea9e9f6356af2bce8ac24321b2ad6d89e3aab64/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e312b2d626c75652e737667)

install
=======

[](#install)

```
composer require "chinawilon/fcm_game: >=2.0"
```

example
=======

[](#example)

**下面使用phpunit的形式请求，记得加上请求时的ip作为测试ip白名单**

*需要通过所有的测试案例，测试案例会有测试码，全部通过以后才可以使用正式接口地址*

```
use AES\AESException;
use GuzzleHttp\Exception\GuzzleException;
use PHPUnit\Framework\TestCase;
use FCM\FCM;

class FCMTest extends TestCase
{
    protected $biz_id = '1101999999';

    protected $app_id = 'e44158030c7341819aedf04a147f3e8a';

    protected $key = 'd59bbdefd68b71f906c4d67e52841700';

    /**
     * @var FCM
     */
    protected $fcm;
    /**
     * @var string
     */

    private $ai;

    /**
     * FCMTest constructor.
     *
     * @param null $name
     * @param array $data
     * @param string $dataName
     */
    public function __construct($name = null, array $data = [], $dataName = '')
    {
        $this->fcm = new FCM($this->app_id, $this->biz_id, $this->key, 20);
        parent::__construct($name, $data, $dataName);
    }

    /**
     * phpunit 测试
     * @throws AESException
     * @throws GuzzleException
     */
    public function testExample()
    {
        $check = $this->fcm->check('100000000000000001', '某一一', '110000190101010001');
        $this->assertStringContainsString('errcode', $check);

        $testCheck = $this->fcm->testCheck('100000000000000001', '某一一', '110000190101010001', 'yA2RxS');
        $this->assertStringContainsString('errcode', $testCheck);

        $query = $this->fcm->query('100000000000000001');
        $this->assertStringContainsString('errcode', $query);

        $testQuery = $this->fcm->testQuery('100000000000000001', 'HHatGD');
        $this->assertStringContainsString('errcode', $testQuery);

        $logout = $this->fcm->loginOrOut([['bt'=>1, 'ct'=>0, 'pi'=>'1fffbjzos82bs9cnyj1dna7d6d29zg4esnh99u']]);
        $this->assertStringContainsString('errcode', $logout);

        $testLogout = $this->fcm->testLoginOrOut([['bt'=>1, 'ct'=>0, 'pi'=>'1fffbjzos82bs9cnyj1dna7d6d29zg4esnh99u']], '99u6kr');
        $this->assertStringContainsString('errcode', $testLogout);
    }

    /**
     * check
     *
     * @throws AESException|GuzzleException
     */
    public function testCheck()
    {
        // 认证成功
        echo "\n";
        echo $this->fcm->testCheck('100000000000000001', '某一一', '110000190101010001', 'yA2RxS');
        echo $this->fcm->flushInfo();

        // 认证中
        echo $this->fcm->testCheck('200000000000000001', '某二一', '110000190201010009', '3xTBoG');
        echo $this->fcm->flushInfo();

        // 认证失败
        echo $this->fcm->testCheck('300000000000000001', '某三一', '110000190201010009', 'hkqdzR');
        echo $this->fcm->flushInfo();

    }

    /**
     * query
     *
     * @throws Exception|GuzzleException
     */
    public function testQuery()
    {
        // 认证成功
        echo "\n";
        echo $this->fcm->testQuery('100000000000000001', 'HHatGD');
        echo $this->fcm->flushInfo();

        // 认证中
        echo $this->fcm->testQuery('200000000000000001', 'BwgbTE');
        echo $this->fcm->flushInfo();

        // 认证失败
        echo $this->fcm->testQuery('300000000000000001', 'whzSne');
        echo $this->fcm->flushInfo();

    }

    /**
     * login or logout
     *
     * @throws Exception|GuzzleException
     */
    public function testLoginOrOut()
    {
        // 游客模式
        echo "\n";
        echo $this->fcm->testLoginOrOut([['bt'=>0, 'ct'=>2, 'di'=>md5('device')]], 'BUSRy9');
        echo $this->fcm->flushInfo();

        // 认证模式
        echo $this->fcm->testLoginOrOut([['bt'=>1, 'ct'=>0, 'pi'=>'1fffbjzos82bs9cnyj1dna7d6d29zg4esnh99u']], '99u6kr');
        echo $this->fcm->flushInfo();
    }

}
```

License
=======

[](#license)

MIT

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~7 days

Total

2

Last Release

1906d ago

Major Versions

2.0 → 3.02021-04-08

### Community

Maintainers

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

---

Top Contributors

[![chinawilon](https://avatars.githubusercontent.com/u/13992306?v=4)](https://github.com/chinawilon "chinawilon (1 commits)")[![longdahai](https://avatars.githubusercontent.com/u/1285394?v=4)](https://github.com/longdahai "longdahai (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/longdahai-fcm-game/health.svg)

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

749284.3k37](/packages/civicrm-civicrm-core)[roundcube/roundcubemail

The Roundcube Webmail suite

7.0k1.4k3](/packages/roundcube-roundcubemail)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[nfse-nacional/nfse-php

This is my package nfse

1523.1k](/packages/nfse-nacional-nfse-php)

PHPackages © 2026

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