elmogy/fcm
最新稳定版本:v1.4
Composer 安装命令:
composer require elmogy/fcm
包简介
A Laravel package for FCM (Firebase Cloud Messaging) integration.
README 文档
README
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
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-24