承接 hatasever/onesignal 相关项目开发

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

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

hatasever/onesignal

最新稳定版本:1.0.5

Composer 安装命令:

composer require hatasever/onesignal

包简介

Onesignal push Notification api

README 文档

README

It allows you to send notifications via laravel using Onesignal push notification service.

Installation

Install the dependencies and devDependencies.

"```sh composer require hatasever/onesignal


Add these 3 parameters to the .env file

```sh
ONESIGNAL_APP_ID= Onesignal App id
ONESIGNAL_REST_API_KEY= Onesignal Api Key
USER_AUTH_KEY= OneSignal Auth Key

Add it to the service provider array in the config/app.php file

 'providers' => [
   .
   .
   
   * Package Service Providers...
     Hatasever\OneSignal\OneSignalServiceProvider::class,

     ],
     
 'aliases' => [
    .
    .
    .
    'OneSignal' =>     Hatasever\OneSignal\OneSignalServiceProvider::class,
 ]

Send Notifications

    use OneSignal;

      $params = [];
                              $params['include_external_user_ids'] = [$userId];
                              /* Mobile app icon */
                              $params['small_icon'] = 'mdpi'; 
                              $params['large_icon'] = 'xxxhdpi';
                              $contents = [
                              "en" =>'Hello World!',
                              "tr" => 'Merhaba Dünya!',
                              ];
                              $params['contents'] = $contents;


                              OneSignal::sendNotificationCustom($params);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-17