定制 samtny/fastapns 二次开发

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

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

samtny/fastapns

Composer 安装命令:

composer require samtny/fastapns

包简介

Library for pushing APNs notifications to Apple's servers at warp speed

README 文档

README

This library will send push notifications to Apple as fast as possible, and report any bad tokens.

Inspired by this StackOverflow post:

http://stackoverflow.com/a/18491136/1569360

... and careful reading of 'Troubleshooting Push Notifications' here:

https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG44

Example Usage:

$payload = array(
    'aps' => array(
        'alert' => 'some alert',
    ),
);

$tokens = array(
    'ca360e9029938b9ed8ed435640f3760620526bd72037017d3c50cfa264b7914f',
    'ca360e9029938b9ed8ed435640f3760620526bd72037017d3c50cfa264b79150',
    'ca360e9029938b9ed8ed435640f3760620526bd72037017d3c50cfa264b79151',
    'ca360e9029938b9ed8ed435640f3760620526bd72037017d3c50cfa264b79152',
    'ca360e9029938b9ed8ed435640f3760620526bd72037017d3c50cfa264b79153',
);

$expiry = (new \DateTime('+24 hours'))->getTimestamp();

$client = FastAPNS\ClientBuilder::create()
    ->setLocalCert(__DIR__ . '/ssl/MyAppCertificate.includesprivatekey.pem')
    ->setPassphrase('p@ssword')
    ->build();

$client->send($payload, $tokens, $expiry);

var_dump($client->getBadTokens());

Ensure that your APNS certificate is encoded in PEM format and includes the private key. This file should be set to mode 0400.

END

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固