Package Data | |
---|---|
Maintainer Username: | wcj343169893 |
Maintainer Contact: | houguangcong@163.com (houguangcong) |
Package Create Date: | 2018-06-05 |
Package Last Update: | 2018-06-05 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2025-01-29 15:11:23 |
Package Statistics | |
---|---|
Total Downloads: | 36 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
$ composer install "mofing/umeng":"~1.1"
或者修改composer.json
{
"require": {
"mofing/umeng": "~1.1"
}
}
Android用法:
use UmengPusher\Umeng\Pusher\UmengPusher;
$settings = [
"android" => [
"app_key" => "aaa",
"app_master_secret" => "bbbb"
],
"product" => false
];
$umeng = new UmengPusher($settings);
$device_token = 'xxxx';
$predefined = [
"after_open" => "go_custom",
"ticker" => "测试提示文字",
"title" => "测试标题",
"text" => "测试文字描述",
"custom" => [
"name" => "ddd"
]
];
$extraField = array(); //other extra filed
$umeng->android()->sendUnicast($device_token,$predefined,$extraField); //单播
IOS用法:
use UmengPusher\Umeng\Pusher\UmengPusher;
$settings = [
"ios" => [
"app_key" => "aaa",
"app_master_secret" => "bbbb"
],
"product" => false
];
$UmengPusher=new UmengPusher($settings);
$device_token = 'xxxx';
$predefined = [
'alert' => [
"title" => "title",
"subtitle" => "subtitle",
"body" => "这里是消息数据"
]
];
$customField = array(); //other custom filed
$UmengPusher->ios()->sendUnicast($device_token,$predefined,$customField); //单播