janmeier/gcm-sender

使用PHP和curl发送Google Cloud Messages (GCM)的轻量级库。

dev-master 2015-11-03 10:36 UTC

This package is not auto-updated.

Last update: 2024-09-24 08:07:48 UTC


README

Build Status

通过PHP发送GCM消息并处理结果代码。超级轻量级!

模块要求

  • php5-curl

使用示例

只需将其添加到您的composer文件中!

这里是一个示例composer.json文件

{
    "repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/Jan1337z/GCM-via-PHP"
    }
    ],
    "require": {
        "GCMSender": "dev-master"
    }
}

可能的index.php

<?php
    require 'vendor/autoload.php';
    $sender = new GCM\Sender("YOUR_API_KEY");
    $sender->setRecipients(array("a_android_client_registration_id"));
    $sender->sendMessage(array("message" => "some_content"));
?>

更多内容!