digitalap/fcmhttpbundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

digitalap/fcmhttpbundle

Composer 安装命令:

composer require digitalap/fcmhttpbundle

包简介

A bundle to send notifications to mobile devices through Google FCM with the HTTP protocol

README 文档

README

Firebase Cloud Messaging Bundle of Symfony

Installation

By composer

  composer require digitalap/fcmhttpbundle

Enable the Bundle

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new DigitalAp\FcmHttpBundle\FcmHttpBundle(),
        );

        // ...
    }

    // ...
}

Configuration

# app/config/config.yml

fcm_http:
  autentication_api_key: keycode ....

Usage

The notification has multiple properties, see FCM [documentation] (https://firebase.google.com/docs/cloud-messaging/http-server-ref) to view. You'll find everyone at FcmHttpBUndle with their getters and setters.

        //A MESSAGE MAY HAVE A NOTIFICATION OR NO
        $notification = new Notification('Text','Body');
        $notification->enableSound();
        
        //Put that one or more relations_id. Message expects an array as parameter
        //If it is greater than a thousand relations_ids the bundle will send the messages in a thousand
        $message = new Message(array(
            '0'
            '1'
        ));
        
        //A message may not have a notification or a data, but it must have one of the two.
        $message->setNotification($notification);
        
        $guzzle = $this->get('fcm_http.send')->send($message);
        
        // response for server 
        dump(guzzle)
        //Each index of the array returned by the response means a lot of one thousand messages
        dump($guzzle[0]->getBody()->getContents());

This bundle uses the Guzzle php library

License FcmHttpBundle is licensed under the MIT license

统计信息

  • 总下载量: 495
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固