定制 elmogy/fcm 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

elmogy/fcm

最新稳定版本:v1.4

Composer 安装命令:

composer require elmogy/fcm

包简介

A Laravel package for FCM (Firebase Cloud Messaging) integration.

README 文档

README

alt tag

elmogy/fcm

A Laravel package for FCM (Firebase Cloud Messaging) integration .

Features

  • Easy integration with Laravel applications

Requirements

  • PHP 8.0
  • apiclient ^2.0

Installation

composer require elmogy/fcm

Configuration:

# Elmogy Fcm Configuration for Production Environment (.env)
FIREBASE_PROJECT_ID=YOUR_PROJECT_ID
FIREBASE_FILE=FIREBASE_FILE

Instantiating FCM Class

To begin using the FCM functionality, you need to instantiate the elmogy/fcm class. Follow these steps:

Step 1: Import FCM Class

Before you can create an instance of the elmogy/fcm class, ensure that you import it into your PHP file using the use statement:

use elmogy\fcm\FCMService;

Step 2: Instantiate FCM Class

Once the class is imported, you can instantiate it using the following code:

 $fcmService = new FCMService();

This creates an instance of the FCM class, allowing you to utilize its methods and properties for handling FCM within your Laravel application.

How to use :

1 - checkout & session

  • Create session :
    use elmogy\fcm\FCMService;

    $fcmService = new FCMService();

    $fcmToken = "DEVICE_TOKEN"; // Replace with the actual FCM token
    $title    = "Test Notification";
    $body     = "This is a test message.";
    $icon     = "/default.png"; // Optional
    $data     = ['key' => 'value'] ; // Optional

    $response = $fcmService->sendFCM($fcmToken, $title, $body , $icon ,$data);
   

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-24