PHPackages                             jimchen/umeng - 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. jimchen/umeng

ActiveLibrary

jimchen/umeng
=============

友盟推送

1.2.1(6y ago)01.2kMITPHP

Since Dec 5Pushed 6y agoCompare

[ Source](https://github.com/JimChenWYU/UMeng-Push)[ Packagist](https://packagist.org/packages/jimchen/umeng)[ RSS](/packages/jimchen-umeng/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (1)Versions (16)Used By (0)

 umeng
=======

[](#-umeng-)

 友盟推送SDK

[![StyleCI build status](https://camo.githubusercontent.com/501b50da51bf133b82086293b21ffc8307a610c8488cba7e202688f888fcfbc5/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136303534343536332f736869656c64)](https://camo.githubusercontent.com/501b50da51bf133b82086293b21ffc8307a610c8488cba7e202688f888fcfbc5/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3136303534343536332f736869656c64) [![FOSSA Status](https://camo.githubusercontent.com/f144dccdb8b14d679cae5eb7947b30bdd7ff85232cd20b2a0493f6b6a6deae76/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246686564657169616e67253246554d656e672d507573682e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bgithub.com%2Fhedeqiang%2FUMeng-Push?ref=badge_shield)

[![996.icu](https://camo.githubusercontent.com/ac8f294a80f65338db545230f1a881b9a382204a1f187c6ff40ee679d42d40ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c696e6b2d3939362e6963752d7265642e737667)](https://996.icu)[![LICENSE](https://camo.githubusercontent.com/be80b8cb211ceb2263744e99fdb161a40124901906fd7c7f47d6361760dd7e8b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d416e74692532303939362d626c75652e737667)](https://github.com/996icu/996.ICU/blob/master/LICENSE)[![HitCount](https://camo.githubusercontent.com/2663b52e90c7cd134a35203703b1c4d7771af657479f28cf8140cd0ddbca1f41/687474703a2f2f686974732e6477796c2e696f2f686564657169616e672f756d656e672e737667)](http://hits.dwyl.io/hedeqiang/umeng)

Installing
----------

[](#installing)

```
$ composer require jimchen/umeng -vvv
```

配置
--

[](#配置)

在使用本扩展之前，你需要去 [友盟+](https://message.umeng.com) 注册账号，然后创建应用，获取应用的 Key 和秘钥。

使用
--

[](#使用)

```
require __DIR__ .'/vendor/autoload.php';

use Hedeqiang\UMeng\Android;
use Hedeqiang\UMeng\IOS;

// Android
$config = [
    'appKey' => '5b1df1**************',
    'appMasterSecret' => 'i7tzdarsw************',
    'production_mode' => true,
];
// IOS
$ios_config = [
    'appKey' => '5b1df0d1************',
    'appMasterSecret' => 'fa9ry9kd*********',
    'production_mode' => true,
]

$android = new Android($config));

$ios = new IOS($ios_config);
```

Android
-------

[](#android)

### customizedcast消息发送示例

[](#customizedcast消息发送示例)

```
$params = [
    'alias_type' => 'APP',
    'alias' => 1,
    "ticker" => "测试提示文字",
    "title" => "测试标题",
    "text" => "测试文字描述",
    "after_open" => "go_app",
    "description" => "测试广播通知-Android",
];

$response = $android->sendAndroidCustomizedcast($params);

```

### broadcast消息发送示例

[](#broadcast消息发送示例)

```
$params = [
    "ticker" => "测试提示文字",
    "title" => "测试标题",
    "text" => "测试文字描述",
    "after_open" => "go_app",

];
$extra = [
    'key1' => 'val1',
    'key2' => 'val2',
];

$response = $android->sendAndroidBroadcast($params, $extra);

```

### unicast消息发送示例

[](#unicast消息发送示例)

```
$params = [
    "device_tokens" => "测试提示文字",
    "display_type" => "notification", // message：消息 notification：通知
    //"custom" => '自定义custom',
    //以下内容为 notification  必填项
    "ticker" => "测试提示文字",
    "title" => "测试标题",
    "text" => "测试文字描述",
    "after_open" => "go_app",

];
//可选项
$extra = [
    'key1' => 'val1',
    'key2' => 'val2',
];

$response = $android->sendAndroidUnicast($params, $extra);

```

### filecast消息发送示例

[](#filecast消息发送示例)

```
$params = [
    "ticker" => "测试提示文字",
    "title" => "测试标题",
    "text" => "测试文字描述",
    "after_open" => "go_app",
];
//
$content = "aa" . "\n" . "bb";

$response = $android->sendAndroidFilecast($params, $content);

```

### groupcast消息发送示例

[](#groupcast消息发送示例)

```
$params = [
    "ticker" => "测试提示文字",
    "title" => "测试标题",
    "text" => "测试文字描述",
    "after_open" => "go_app",
];
//

$filter = [
    'where' => [
        'and' => [
            'tag' => 'test',
            'tag1' => 'test2',
        ],
    ],
];

$response = $android->sendAndroidGroupcast($filter, $params);

```

### sendAndroidCustomizedcastFileId 消息示例

[](#sendandroidcustomizedcastfileid-消息示例)

```
 $params = [
    "ticker" => "测试提示文字",
    "title" => "测试标题",
    "text" => "测试文字描述",
    "after_open" => "go_app",
    'alias_type' => 'APP',
];
$content = "aa" . "\n" . "bb";

$response = $android->sendAndroidCustomizedcastFileId($params, $content);

```

IOS
---

[](#ios)

### broadcast消息发送示例

[](#broadcast消息发送示例-1)

```
$params = [
    'alert' => [
        'title' => 'title',
        'body' => 'body',
    ],  //字符串或者JSON
    "description" => "测试广播通知-iOS"
];
$customized = [
    'key' => 'jey',
]; //可选
$response = $ios->sendIOSBroadcast($params, $customized);

```

### unicast消息发送示例

[](#unicast消息发送示例-1)

```
$params = [
    'device_tokens' => 'token',
    'alert' => [
        'title' => 'title',
        'body' => 'body',
    ],  //字符串或者JSON
    "description" => "测试单播消息-iOS"
];
$customized = [
    'key' => 'jey',
]; //可选
$response = $ios->sendIOSUnicast($params, $customized);

```

### filecast消息发送示例

[](#filecast消息发送示例-1)

```
$params = [
    'device_tokens' => 'token',
    'alert' => [
        'title' => 'title',
        'body' => 'body',
    ],  //字符串或者JSON
    "description" => "测试filecast文件通知-iOS"
];
$content = "aa" . "\n" . "bb";

$response = $ios->sendIOSFilecast($params, $content);

```

### groupcast消息发送示例

[](#groupcast消息发送示例-1)

```
$params = [
    'alert' => [
        'title' => 'title',
        'body' => 'body',
    ],  //字符串或者JSON
    "description" => "测试组播通知-iOS"
];
$filter = [
    'where' => [
        'and' => [
            'tag' => 'test',
            'tag1' => 'test2',
        ],
    ],
];

$response = $ios->sendIOSGroupcast($filter, $params);

```

### customizedcast消息发送示例

[](#customizedcast消息发送示例-1)

```
$params = [
    'alert' => [
        'title' => 'title',
        'body' => 'body',
    ],  //字符串或者JSON
    'alias_type' => 'APP',
    'alias' => 1,
    "description" => "测试alias通知-iOS"
];

$response = $ios->sendIOSCustomizedcast($params);

```

参考
--

[](#参考)

- [U-Push API 集成文档](https://developer.umeng.com/docs/66632/detail/68343)

工具
--

[](#工具)

[![](https://camo.githubusercontent.com/012b96622220782d301096190643c6eb350439b160468aa724f78b5b0251b727/68747470733a2f2f757079756e2e6c61726176656c636f64652e636e2f75706c6f61642f4a6574427261696e732f6a6574627261696e732d747261696e696e672d706172746e65722e706e67)](https://www.jetbrains.com/?from=UMeng-Push)

License
-------

[](#license)

MIT

[![FOSSA Status](https://camo.githubusercontent.com/7edc58700a7453a56629c82dd9a7d3e511f0d49886e2032d37031b6660d530e8/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d253246686564657169616e67253246554d656e672d507573682e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgithub.com%2Fhedeqiang%2FUMeng-Push?ref=badge_large)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 83.6% 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 ~31 days

Recently: every ~17 days

Total

12

Last Release

2370d ago

Major Versions

0.0.4 → 1.0.02019-04-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/20cebafc45fd6fc5f67bf655119a3b27e9b208e248f2d7f5c98fd6c0a101485b?d=identicon)[jimchen](/maintainers/jimchen)

---

Top Contributors

[![hedeqiang](https://avatars.githubusercontent.com/u/31909061?v=4)](https://github.com/hedeqiang "hedeqiang (61 commits)")[![JimChenWYU](https://avatars.githubusercontent.com/u/12371374?v=4)](https://github.com/JimChenWYU "JimChenWYU (11 commits)")[![fossabot](https://avatars.githubusercontent.com/u/29791463?v=4)](https://github.com/fossabot "fossabot (1 commits)")

---

Tags

phpsdkumengU-Push

### Embed Badge

![Health badge](/badges/jimchen-umeng/health.svg)

```
[![Health](https://phpackages.com/badges/jimchen-umeng/health.svg)](https://phpackages.com/packages/jimchen-umeng)
```

###  Alternatives

[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.3M14](/packages/xeroapi-xero-php-oauth2)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[resend/resend-php

Resend PHP library.

564.7M21](/packages/resend-resend-php)[hedeqiang/umeng

友盟推送

3423.8k](/packages/hedeqiang-umeng)[zenditplatform/zendit-php-sdk

PHP client for Zendit API

1204.3k](/packages/zenditplatform-zendit-php-sdk)[kinde-oss/kinde-auth-php

Kinde PHP SDK for authentication

2369.5k3](/packages/kinde-oss-kinde-auth-php)

PHPackages © 2026

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