Ejemplo n.º 1
0
 /**
  * @return VNoticeService
  */
 public static function getInstance()
 {
     if (null === self::$instance) {
         $clz = __CLASS__;
         self::$instance = new $clz();
     }
     return self::$instance;
 }
Ejemplo n.º 2
0
<?php

require_once dirname(__FILE__) . '/VNoticeService.class.php';
$vnoticeService = VNoticeService::getInstance();
// see in http://www.vtongzhi.com/secure/token
$ak = 'ak_value';
$sk = 'sk_value';
$content = 'test from sdk';
$mid = $vnoticeService->sendMessage($ak, $sk, $content);
var_dump($mid);
sleep(1);
$messageStatus = $vnoticeService->checkMessage($ak, $sk, $mid);
var_dump($messageStatus);