PHPackages                             chinawilon/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. chinawilon/fcm\_game

ActiveLibrary

chinawilon/fcm\_game
====================

fcm package for game

2.0(5y ago)71292MITPHPPHP &gt;=7.1

Since Apr 1Pushed 5y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (2)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

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1867d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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