定制 kozhindev/expo-server-sdk-php 二次开发

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

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

kozhindev/expo-server-sdk-php

Composer 安装命令:

composer require kozhindev/expo-server-sdk-php

包简介

Server-side library for working with Expo push notifications using PHP

README 文档

README

Server-side library for working with Expo push notifications using PHP

Usage

  • Require the package in your project
composer require kozhindev/exponent-server-sdk-php
  • In a php file
    require_once __DIR__.'/vendor/autoload.php';
    
    $token = 'ExponentPushToken[unique]';
    
    $expo = new \ExponentPhpSDK\Expo();
    
    // Build the notification data
    $notification = ['body' => 'Hello World!'];
    
    // Notify a token (or several tokens) with a notification
    $expo->notify([$token], $notification);

Data can be added to notifications by providing it as a JSON object. For example:

// Build the notification data
$notification = ['body' => 'Hello World!', 'data'=> json_encode(array('someData' => 'goes here'))];

Additional security

If you set up enhanced security in your Expo Dashboard (as described here), you will need to attach an authorization token to each push request:

    // ...
    
    // Bootup an expo instance
    $expo = \ExponentPhpSDK\Expo::normalSetup();
    
    // Fetch your access token from where you stored it
    $accessToken = 'your_expo_access_token';
    
    // The access token will be attached to every push request you make hereafter
    $expo->setAccessToken($accessToken);
    
    // Notify an interest with a notification
    $expo->notify([$channelName], $notification);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-08-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固