Download the PHP package yunchuang/push without Composer

On this page you can find all versions of the php package yunchuang/push. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package push

MingYuanYun Push Library

平台支持


环境需求

安装


使用

通道

目前支持以下通道:

设备token

通过推送插件获得,支持以数组形式传入多个。

鉴于各厂商对多推的支持不一,建议单次最多100个设备。

推送内容

由于各厂商对推送的支持不一,现抽象定义了以下公有属性:

参数 类型 说明
businessId string 业务ID,相同业务ID只推送一次
title string 标题
subTitle string 副标题
content string 内容
badge string 角标
extra array 服务端传给APP的自定义数据,建议转换为json字符串后长度不超过1024字节
callback string 送达回执地址,供推送厂商调用,最大128个字节,具体请查阅各厂商文档。华为仅支持在应用管理中心配置;魅族需在管理后台注册回执地址,每次推送时也需指定回执地址;苹果ios-token通道由SDK调用回执
callbackParam string 自定义回执参数
notifyId string 聚合标签,同标签消息在通知栏只显示一条。小米通道支持,字母、数字组合不超过8位
gatewayOptions array 厂商扩展参数

gatewayOptions厂商扩展参数说明

考虑到各厂商均有自己特有的参数,故提供此扩展参数来提供支持。如果扩展参数与通用参数有冲突,则取扩展参数中值。 参数类型为以厂商通道为键名的数组,格式如下:

示例

附加信息

参数 类型 说明
token string 认证token
push Apns\Client iOS证书推送实例,考虑到文件I/O问题,故此设计

标题等长度限制说明

当前库将根据以下厂商限制进行处理,请调用方根据实际情况设置标题等内容

厂商 标题 副标题 描述 回执地址 回执参数
华为 未说明 - 未说明 - -
小米 未说明 - 未说明 未说明 64
OPPO 50 10 200 200 50
VIVO 20 - 50 128 64
魅族 32 - 100 128 64
苹果 未说明 未说明 未说明 - -

角标说明

目前仅华为、华为新版、ios、ios-token通道支持角标。其中华为新版支持角标累加,格式为+1,其他通道将只取数字值。


推送

认证

目前华为华为新版OppoVivoios-token推送前需要获取先获取认证token,且对获取频次均有限制,故统一提供了获取token方法getAuthToken,建议缓存认证token,过期时间较返回的有效时间短,比如2小时。

此方法返回格式如下:

其余通道将返回null

缓存的认证token请以附加信息传入。

推送角标

目前仅ios ios-token 华为 华为新版支持推送角标

其中华为新版支持角标累加,badge格式为+ 5

返回值

除苹果通道外,其余通道推送成功时均将返回推送任务ID。

调用过程中有可能抛出以下异常,请注意捕获。

也可捕获上述异常的父类MingYuanYun\Push\Exceptions\Exception

自定义通道

本扩展支持自定义通道。

各通道配置参照$config


各通道回执示例

建议判断如果是字符串,则进行json_decode


推送限额说明


Oppo、Vivo推送服务开通答疑


注意


All versions of push with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version >=6.0.0
php Version >=5.4
yunchuang/php-jwt Version ^1.0
gepo/apns-http2 Version ^0.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yunchuang/push contains the following files

Loading the files please wait ....