PHP code example of mob / mobpush

1. Go to this page and download the library: Download mob/mobpush library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mob / mobpush example snippets


# 配置包路径,注意,这里 `../mobpush-websdkv3-php-master` 为相对路径,不要弄错了
$ composer config repositories.mobpush path ../mobpush-websdkv3-php-master    

#安装扩展包
$ composer 

   $mobPushConfig = new MobPushConfig();
   $mobPushConfig::$appkey = 'appkey';
   $mobPushConfig::$appSecret = 'appSecret';

use MobTech\MobPush\Config\MobPushConfig;
use MobTech\MobPush\Client\Push\PushV3Client;

$mobPushConfig = new MobPushConfig();
$mobPushConfig::$appkey = 'appkey';
$mobPushConfig::$appSecret = 'appSecret';

/* Registration ID推送 */
(new PushV3Client())->pushByRids('', 'push title', 'push content', 'rids');

use MobTech\MobPush\Config\MobPushConfig;
use MobTech\MobPush\Client\Stats\StatsV3Client;

$mobPushConfig = new MobPushConfig();
$mobPushConfig::$appkey = 'appkey';
$mobPushConfig::$appSecret = 'appSecret';

/* 根据workId查询统计结果 */ 
(new StatsV3Client())->getStatsByWorkId('workId');