ardabeyazoglu/php-push-helper

此包已废弃,不再维护。没有建议的替代包。

一个简单的辅助库,用于使用fcm、apns等服务在php中发送推送通知。

v0.1.0 2017-07-09 17:09 UTC

This package is auto-updated.

Last update: 2020-08-16 14:29:46 UTC


README

Latest Stable Version License

关于

一个php辅助类,用于向不同的服务发送推送通知。目前,它仅支持APNS和谷歌的FCM

特性

  • 使用APNS,可以向iOS发送消息
  • 使用FCM,可以向iOS、Android、浏览器(Service Workers)或任何监听Firebase Messaging Service的客户端发送消息

安装

composer install ardabeyazoglu/php-push-helper

用法

    $fcmApiKey = "YOUR_FCM_API_KEY";
    
    $push = new \Push\Client();
    $push->setFcm($fcmApiKey);

    // send using fcm
    $regToken = "YOUR_DEVICE_TOKEN";
    $result = $push->emit($regToken, array(
         "title" => "Test push title",
         "body" => "That's it!",
         "custom" => "my custom data"
     ));

请参阅文档示例

待办事项

  • 集成更多服务(Windows Phone 8、UWP、Web Push等)
  • 编写一个辅助类以生成json有效负载