本文整理汇总了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;
}
}