Commit 54971e33 by Jansa Jose

update fcm doctor

parent 86c054b3
...@@ -3933,19 +3933,27 @@ print_r(date('H:i',$ms));exit();*/ ...@@ -3933,19 +3933,27 @@ print_r(date('H:i',$ms));exit();*/
$headers = apache_request_headers(); $headers = apache_request_headers();
//$data =(array) json_decode(file_get_contents("php://input")); //$data =(array) json_decode(file_get_contents("php://input"));
$data = $_POST; $data = $_POST;
if(isset($data['fcm_token']) && strlen($data['fcm_token']) && isset($headers['Auth']) && strlen($headers['Auth'])){ if( isset($headers['Auth']) && strlen($headers['Auth'])){
$check_authToken = $this->Webservice_model->check_auth_token($headers['Auth']); $check_authToken = $this->Webservice_model->check_auth_token($headers['Auth']);
if($check_authToken){ if($check_authToken){
if(isset($data['fcm_token']) && strlen($data['fcm_token'])){
$result = $this->Webservice_model->update_fcm_token_doctor($data,$headers['Auth']); $result = $this->Webservice_model->update_fcm_token_doctor($data,$headers['Auth']);
if($result['status'] == 'success'){ if($result['status'] == 'success'){
$res = array("status"=>'success'); $res = array("status"=>'success');
} }
else if($result['status'] == 'fail'){ else if($result['status'] == 'fail'){
$res = array( $res = array(
"status"=> "error", "status"=> "error",
"error"=> "updation failed", "error"=> "updation failed",
"message"=> "updation failed" "message"=> "updation failed"
); );
}
}else{
$res = array(
"status"=> "error",
"error"=> "Not Valid",
"message"=> "Fcm token is required"
);
} }
} }
else{ else{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment