Ejemplo n.º 1
0
 public function PushTokenAndroid($title, $content, $token)
 {
     $iosConfig = $this->config['Android'];
     $accessId = $iosConfig['accessId'];
     $secretKey = $iosConfig['secretKey'];
     return XingeApp::PushTokenAndroid($accessId, $secretKey, $title, $content, $token);
 }
Ejemplo n.º 2
0
 /**
  * 使用默认配置发个特别简单的通知ANDROID
  * @return 返回push_id
  */
 public static function pushSimpleMessage($paramArr)
 {
     $options = array('accessId' => '', 'secretKey' => '', 'title' => '', 'content' => '', 'token' => '', 'account' => '', 'userId' => '');
     if (is_array($paramArr)) {
         $options = array_merge($options, $paramArr);
     }
     extract($options);
     if (!$accessId || !$secretKey || !$token && !$account || !$content || !$title) {
         return false;
     }
     if ($token) {
         $ret = XingeApp::PushTokenAndroid($accessId, $secretKey, $title, $content, $token);
     } else {
         $ret = XingeApp::PushAccountAndroid($accessId, $secretKey, $title, $content, $account);
     }
     return $ret;
 }
Ejemplo n.º 3
0
<?php

require_once 'XingeApp.php';
//Android 版
//给单个设备下发通知
var_dump(XingeApp::PushTokenAndroid(10000, "secretKey", "title", "content", "token"));
//给单个帐号下发通知
var_dump(XingeApp::PushAccountAndroid(10000, "secretKey", "title", "content", "account"));
//给所有设备下发通知
var_dump(XingeApp::PushAllAndroid(10000, "secretKey", "title", "content"));
//给标签选中设备下发通知
var_dump(XingeApp::PushTagAndroid(10000, "secretKey", "title", "content", "tag"));
//IOS版
//开发环境下 给单个设备下发通知
var_dump(XingeApp::PushTokenIos(10000, "secretKey", "content", "token", XingeApp::IOSENV_DEV));
//开发环境下 给单个帐号下发通知
var_dump(XingeApp::PushAccountIos(10000, "secretKey", "content", "account", XingeApp::IOSENV_DEV));
//开发环境下 给所有设备下发通知
var_dump(XingeApp::PushAllAndroid(10000, "secretKey", "content", XingeApp::IOSENV_DEV));
//开发环境下 给标签选中设备下发通知
var_dump(XingeApp::PushTagAndroid(10000, "secretKey", "content", "tag", XingeApp::IOSENV_DEV));