Commit bbae0b8f by Jansa Jose

dc

parent 453df0d0
<?php <?php
defined('BASEPATH')OR exit('No direct script access allowed'); defined('BASEPATH') OR exit('No direct script access allowed');
header('Content-Type: text/html; charset=utf-8'); header('Content-Type: text/html; charset=utf-8');
if(isset($_SERVER['HTTP_ORIGIN'])) { if(isset($_SERVER['HTTP_ORIGIN'])) {
...@@ -1432,8 +1432,8 @@ ...@@ -1432,8 +1432,8 @@
} }
$fcm_data = $this->Webservice_model->getfcmData($ref,$mobile); $fcm_data = $this->Webservice_model->getfcmData($ref,$mobile);
if($fcm_data['status'] == "success"){ if($fcm_data['status'] == "success"){
$fcm_data['title'] = "CarFixxers"; //$fcm_data['title'] = "CarFixxers";
$fcm_data['message'] = "Mechanic Booking"; //$fcm_data['message'] = "Mechanic Booking";
$this->push_sent_cancel($fcm_data['data']); $this->push_sent_cancel($fcm_data['data']);
} }
if($mobile == '1'){ if($mobile == '1'){
...@@ -1457,10 +1457,9 @@ ...@@ -1457,10 +1457,9 @@
if(empty($key) || empty($fcm_data)){ if(empty($key) || empty($fcm_data)){
return; return;
} }
// $data = "{ \"notification\": { \"title\": \"".$fcm_data['title']."\", \"text\": \"".$fcm_data['message']."\", \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"service_id\" : \"".$fcm_data['booking_id']."\", \"type\" : \"".$fcm_data['service_type']."\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_data['device_id']."\"}";
$data = "{ \"notification\": { \"title\": \"".$fcm_data['title']."\", \"text\": \"".$fcm_data['message']."\", \"sound\": \"default\" }, \"time_to_live\": 60, \"data\" : {\"response\" : {\"status\" : \"success\", \"data\" : {\"service_id\" : \"".$fcm_data['booking_id']."\", \"type\" : \"".$fcm_data['service_type']."\"}}}, \"collapse_key\" : \"trip\", \"priority\":\"high\", \"to\" : \"".$fcm_data['device_id']."\"}";
// $data = "{\"data\":{\"params\":{\"service_id\":\"".$fcm_data['booking_id']."\"},\"type\":\"".$fcm_data['service_type']."\"},\"to\":\"".$fcm_data['device_id']."\"}"; $data = "{\"data\":{\"params\":{\"service_id\":\"".$fcm_data['booking_id']."\"},\"type\":\"".$fcm_data['service_type']."\"},\"to\":\"".$fcm_data['device_id']."\"}";
$ch = curl_init("https://fcm.googleapis.com/fcm/send"); $ch = curl_init("https://fcm.googleapis.com/fcm/send");
$header = array('Content-Type: application/json', 'Authorization: key='.$key); $header = array('Content-Type: application/json', 'Authorization: key='.$key);
......
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