php Aurora Push (Push-API-v3)
error_reporting(E_ALL^E_NOTICE); class ApipostAction{
- private $_appkeys = 'f722b1337ded8********';
- private $_masterSecret = 'bd267a37c3034fd6*******';
-
- function request_post($url="",$param="",$header="") {
- $postUrl = $url; curl_setopt($ch, CURLOPT_HEADER, 0) ;//Set header
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//Require the result to be a string and output it to the screen
- curl_setopt($ch, CURLOPT_POST, 1); //Post submission method
- curl_setopt($ch, Curlopt_postfields, $ CurlPost);
- CURL_SETOPT ($ CH, Curlopt_httpheader, $ Header);
- // Fields in HTTP Header (head) _SSL_verifypeer, FALSE);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
- using with curl using using -
- """""" )
- $url = 'https://api.jpush.cn/v3/push'; $header= array("Authorization:Basic $base64","Content-Type:application/json");
- // print_r($header); $param='{"platform":"all","audience":"all ","notification" : {"alert" : "Hi,JPush!"},"message":{"msg_content":"'.$message.'","title":"'.$title.'"} }';
- $res = $this->request_post($url,$param,$header);
- }
- }
-
- $ jpush=new ApipostAction();
- $jpush->send('this title','this mesage');
-
-
-
-
- Copy code
-
-
-
-
-
-
-
-
-
-
-
-
|