PHP code example of biwankaifa / umeng_push

1. Go to this page and download the library: Download biwankaifa/umeng_push 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/ */

    

biwankaifa / umeng_push example snippets


    composer 



return [
    'ios_app_key' => '',
    'ios_app_master_secret' => '',
    'android_app_key' => '',
    'android_app_master_secret' => '',
    'production_mode' => env('UMENG_MODE', false),
    'mipush'=>false,//可选,默认为false。当为true时,表示MIUI、EMUI、Flyme系统设备离线转为系统下发
    'mi_activity'=>''//可选,mipush值为true时生效,表示走系统通道时打开指定页面acitivity的完整包路径。
];



    use biwankaifa\umeng_push;
    
    $device_token = 'xxxx';
    $predefined = array('ticker' => 'android ticker' ,...);
    $extraField = array(); //other extra filed
    Umeng::android()->sendUnicast($device_token,$predefined,$extraField); //单播


    
    use biwankaifa\umeng_push;
    
    $device_token = 'xxxx';
    $predefined = array('alert' => 'ios alert' ,...);
    $customField = array(); //other custom filed
    Umeng::ios()->sendUnicast($device_token,$predefined,$customField); //单播
    

    
    sendBroadcast($predefined = [], $extraField = []); //广播
    sendUnicast($device_tokens = '', $predefined= [], $extraField = []); //单播
    sendListcast($device_tokens = '', $predefined= [], $extraField = []); //列播
    sendFilecast($fileContents = '', $predefined= [],$extraField = []); //文件播
    sendGroupcast($filter = [], $predefined= [], $extraField = []); //组播
    sendCustomizedcast($alias = '', $alias_type = '', $predefined= [], $extraField = []); //自定义播,通过alias
    sendCustomizedcastFileId($file_contents = '', $predefined= [], $extraField = []); //自定义播,通过file_id