承接 jp/firebase-notification-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jp/firebase-notification-bundle

Composer 安装命令:

composer require jp/firebase-notification-bundle

包简介

A Bundle for Symfony2 projects to send notifications for mobile devices through Firebase Cloud Messaging API

README 文档

README

A Bundle for Symfony4 projects to send notifications for mobile devices through Firebase Cloud Messaging API

Setup

Step 1: Download FirebaseNotificationBundle using composer

Add Firebase Notification in your composer.json:

{
    "require": {
        "jp/firebase-notification-Bundle": "^2.0.0"
    }
}

Now tell composer to download the bundle by running the command:

$ php composer.phar update "jp/firebase-notification-Bundle"

Step 2: Enable the bundle

Enable the bundle in the kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new JP\FirebaseNotificationBundle\JPFirebaseNotificationBundle()
    );
}

Step 3: Add configuration

# app/config/config.yml
jp_firebase_notification:
    firebase_fcm:
        server_key: XXXXXX

Usage

Using service

<?php
        $fcm = $this->get('firebase_fcm_client');
?>

##Example

###Create message and send message

<?php 
    $fcm = $this->get('firebase_fcm_client');
    $fcm->createMessage(array(
        'to' => 'XXXXXXXX',
        'title' => 'New message',
        'body' => 'Hello World!',
        'badge' => 1,
        'data' => array(
            'action' => "new_message"
        )
    ));
    $data = $fcm->sendMessage();
?>

###Create topic message and send message

<?php 
    $fcm = $this->get('firebase_fcm_client');
    $fcm->createMessage(array(
        'topic' => '/topics/TOPIC_NAME',
        'title' => 'New message',
        'body' => 'Hello World!',
        'badge' => 1,
        'data' => array(
            'action' => "new_message"
        )
    ));
    $data = $fcm->sendMessage();
?>

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-03-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固