/** * 运行环境 develop:开发环境 product:生产环境 * @var string */ private $_environment = 'develop';
/** * 设备系统类型 android ios * @var string */ private $_osType = '';
/** * 小米推送域名 * @var string */ private $_host = '';
/** * 请求头 * @var string */ private $_headers = '';
/** * 接口url * @var string */ private $_url = '';
/** * 调用的接口方法名称 * @var array */ private $_function = [];
/** * 请求参数 * @var array */ private $_data = [];
/** * 小米推送设置 * @var array */ private $_options = [ 'title' => '消息通知自定义title', 'restricted_package_name' => '', 'pass_through' => 0, // 0 通知栏消息 1 透传 'notify_type' => -1, // -1:默认所有,1:使用默认提示音提示,2:使用默认震动提示,4:使用默认led灯光提示 'time_to_send' => 0, // 定时推送 单位毫秒 默认0 ];
/** * 运行环境配置 * @var array */ private static $_environmentConfig = [ 'domain' => [ 'product' => 'https://api.xmpush.xiaomi.com/', 'develop' => 'https://sandbox.xmpush.xiaomi.com/' ], ];
/** * 小米推送接口信息定义 * * url/请求参数 * @var array */ private $_functionDefine = [ 'regid' => [ 'uri' => 'v3/message/regid', 'arguments' => [ 'registration_id' => [ 'type' => 'array', 'must' => 'y' ], 'description' => [ 'type' => 'string', 'must' => 'y' ], 'params' => [//自定义参数 'type' => 'array', 'must' => 'n' ], ] ], 'userAccount' => [ 'uri' => 'v2/message/user_account', 'arguments' => [ 'user_account' => [ 'type' => 'array', 'must' => 'y' ], 'description' => [ 'type' => 'string', 'must' => 'y' ], 'params' => [//自定义参数 'type' => 'array', 'must' => 'n' ], ] ], 'alias' => [ 'uri' => 'v3/message/alias', 'arguments' => [ 'alias' => [ 'type' => 'array', 'must' => 'y' ], 'description' => [ 'type' => 'string', 'must' => 'y' ], 'params' => [//自定义参数 'type' => 'array', 'must' => 'n' ], ] ], 'topic' => [ 'uri' => 'v3/message/topic', 'arguments' => [ 'topics' => [ 'type' => 'array', 'must' => 'y' ], 'description' => [ 'type' => 'string', 'must' => 'y' ], 'params' => [//自定义参数 'type' => 'array', 'must' => 'n' ], ] ], 'multiTopic' => [ 'uri' => 'v3/message/multi_topic', 'arguments' => [ 'topics' => [ 'type' => 'array', 'must' => 'y' ], 'topics_op' => [// UNION并集,INTERSECTION交集,EXCEPT差集 'type' => 'string', 'must' => 'y' ], 'description' => [ 'type' => 'string', 'must' => 'y' ], 'params' => [//自定义参数 'type' => 'array', 'must' => 'n' ], ] ], 'all' => [ 'uri' => 'v3/message/all', 'arguments' => [ 'description' => [ 'type' => 'string', 'must' => 'y' ], 'params' => [//自定义参数 'type' => 'array', 'must' => 'n' ], ] ], ];
|