當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Pusher::pushbyID方法代碼示例

本文整理匯總了PHP中Pusher::pushbyID方法的典型用法代碼示例。如果您正苦於以下問題:PHP Pusher::pushbyID方法的具體用法?PHP Pusher::pushbyID怎麽用?PHP Pusher::pushbyID使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Pusher的用法示例。


在下文中一共展示了Pusher::pushbyID方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: registerPushNotif

 public function registerPushNotif()
 {
     IMBAuth::checkOAuth();
     $app_id = addslashes($_POST['app_id']);
     $app_token = addslashes($_POST['app_token']);
     $app = new AppAccount();
     $app->getByID($app_id);
     if ($app->app_token != $app_token) {
         $json['status_code'] = 0;
         $json['status_message'] = "Token Mismatched";
         echo json_encode($json);
         die;
     }
     $acc_id = addslashes($_POST['acc_id']);
     $now = addslashes($_POST['now']);
     $ios = addslashes($_POST['ios']);
     $_GET['ios'] = $ios;
     $push_title = addslashes($_POST['push_title']);
     $push_msg = addslashes($_POST['push_msg']);
     $push_url = addslashes($_POST['push_url']);
     $push_img = addslashes($_POST['push_img']);
     $push_date = date("Y-m-d", strtotime(addslashes($_POST['push_date'])));
     $push_time = (int) addslashes($_POST['push_time']);
     $img = '';
     if ($push_img != '') {
         $img = Crud::savePic($push_img);
     }
     $push = new PushNotCamp();
     $push->camp_client_id = $app->app_client_id;
     $push->camp_img = $img;
     $push->camp_name = $push_title;
     $push->camp_title = $push_title;
     $push->camp_active = 1;
     $push->camp_start = $push_date;
     $push->camp_hour = $push_time;
     $push->camp_msg = $push_msg;
     $push->camp_url = $push_url;
     $push->camp_create_by = $acc_id;
     $push->camp_app_id = $app->app_id;
     $camp_id = $push->save();
     if ($camp_id) {
         $json['status_code'] = 1;
         if ($now) {
             //langsung do push
             $succ = Pusher::pushbyID($camp_id);
             $json['status_message'] = "Push Notifications Pushed";
             echo json_encode($json);
             die;
         } else {
             $json['status_message'] = "Push Notifications Registration Success";
             echo json_encode($json);
             die;
         }
     } else {
         $json['status_code'] = 0;
         $json['status_message'] = "Push Notifications Registration Failed";
         echo json_encode($json);
         die;
     }
 }
開發者ID:CapsuleCorpIndonesia,項目名稱:apel-enak,代碼行數:60,代碼來源:CapsuleMe.php


注:本文中的Pusher::pushbyID方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。