本文整理匯總了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;
}
}