PHPackages                             code-lives/app-push-tpns - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. code-lives/app-push-tpns

ActiveLibrary

code-lives/app-push-tpns
========================

腾讯 移动推送 TPNS

v1.1.0(3y ago)55501MITPHP

Since Sep 6Pushed 3y ago1 watchersCompare

[ Source](https://github.com/code-lives/Tencent-app-push)[ Packagist](https://packagist.org/packages/code-lives/app-push-tpns)[ RSS](/packages/code-lives-app-push-tpns/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

腾讯 移动推送 TPNS（点个收藏是我前进的动力）
=========================

[](#腾讯-移动推送-tpns点个收藏是我前进的动力)

[官方接口文档](https://cloud.tencent.com/document/product/548/39059)

安装
==

[](#安装)

```
composer require code-lives/app-push-tpns 1.1.0

```

配置参数说明
======

[](#配置参数说明)

> 需要配置的参数

参数名字类型说明appidstring申请的appidsecretKeystring申请的appsecretkeyenvironmentstring用户指定推送环境，仅限 iOS 平台推送使用 默认 product；推送生产环境；dev推送开发环境### Config Demo

[](#config-demo)

> 本地config的配置

```
   $config = [
       'appid' => '',
       'secretKey' => '',
       'environment'=>''
   ];

```

全量推送
====

[](#全量推送)

> 给所有安装app的用户发送消息。

```
   $content=[
       'title'=>'标题',
       'content'=>'内容'
       ];
   $app_push = new AppPush($config);
   $app_push->send_all($content,'notify');

```

单账号推送或多账号推送
===========

[](#单账号推送或多账号推送)

> 一对一给用户发送消息 或 多个账号发送消息

参数名字类型说明contentstring内容accountarray根据数量判断 单账号或多账号推送message\_typestring默认：notify(可不传);notify：通知;message：透传消息/静默消息```
   $account=['one'];//单账号推送
   $account=['one','two'];//多个账号推送
   $app_push->send_account($content, $account,$message_type);

```

单设备推送或多设备推送
===========

[](#单设备推送或多设备推送)

> 单或多设备推送 传递数量判断

参数名字类型说明contentstring内容tokenarray根据数量判断 单设备或多设备message\_typestring默认：notify(可不传);notify：通知;message：透传消息/静默消息```
   $token=['one'];//单设备推送
   $token=['one','two'];//多个设备推送
   $app_push->send_token($content, $token,$message_type);

```

标签推送
====

[](#标签推送)

> tag 字段根据开发文档 tag\_items 字段 自定义

参数名字类型说明contentstring内容tagarray根据开发文档 tag\_items 字段 封装message\_typestring默认：notify(可不传); notify：通知;message：透传消息/静默消息```
   $app_push->send_tag($content, $tag,$message_type);

```

标签绑定与解绑
=======

[](#标签绑定与解绑)

参数名字类型说明operator\_typeint类型看官方文档1-10arrayarrayoperator\_type(1-8) \['token\_list'=&gt;\] operator\_type(9-10) \['tag\_token\_list'=&gt;\]tag\_arrayarrayoperator\_type = 1,2,3,4,6,7,8时 \['tag\_list'=&gt;\] operator\_type(9-10)可不传递```
  //1-8
  $operator_type = 1;
  $array = ['token_list' => []];
  $tag_array = ['tag_list' => []];
  $app_push->set_tag($operator_type, $array = [], $tag_array = []);

  //9-10
  $operator_type = 9;
  $array = ['tag_token_list' => []];
  $app_push->set_tag($operator_type, $array = []);

```

删除标签下所有设备
=========

[](#删除标签下所有设备)

参数名字类型说明tag\_listarray待删除标签列表："tag\_list": \["test\_tag\_3\_Ik0N0", "test\_tag\_2\_Ik0N0"\]```
   $app_push->delete_tag(['tag_list'=>[]]);

```

账号绑定与解绑
=======

[](#账号绑定与解绑)

> array 根据开发文档-&gt;账号相关接口-&gt;账号绑定与解绑

参数名字类型说明operator\_typeint类型看官方文档arrayarray查看文档```
  $operator_type = 1;
  $array = ['account_list' => []];
  $array = ['token_list' => []];
  $array = ['token_accounts' => []];
  $app_push->account_save($operator_type, $array);

```

账号查询
====

[](#账号查询)

> array 根据开发文档-&gt;账号相关接口-&gt;账号设备绑定查询

参数名字类型说明operator\_typeint类型看官方文档arrayarray查看文档```
  $operator_type = 1;
  $array = ['account_list' => []];
  $array = ['token_list' => []];
  $app_push->account_query($operator_type, $array);

```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1349d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66c8ab94602f8fde6cbb339ec8b9b0dbd178b1aeab8973d957e3903d14e2b7be?d=identicon)[code-lives](/maintainers/code-lives)

---

Top Contributors

[![code-lives](https://avatars.githubusercontent.com/u/79346591?v=4)](https://github.com/code-lives "code-lives (18 commits)")

### Embed Badge

![Health badge](/badges/code-lives-app-push-tpns/health.svg)

```
[![Health](https://phpackages.com/badges/code-lives-app-push-tpns/health.svg)](https://phpackages.com/packages/code-lives-app-push-tpns)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
