diff --git a/application/controllers/Notification.php b/application/controllers/Notification.php index d0bd58a..8e8ea7d 100644 --- a/application/controllers/Notification.php +++ b/application/controllers/Notification.php @@ -125,7 +125,7 @@ class Notification extends CI_Controller { 'title'=>$event_data->event_name_EN, 'param'=>'event_id', 'message'=>$message); - push_sent_cancel($user['fcm_token'],$userData); + push_sent_cancel(1,$user['fcm_token'],$userData); } $flashMsg['class'] = 'success'; @@ -156,7 +156,7 @@ class Notification extends CI_Controller { 'param'=>'booking_id', 'title'=>$bData['event_name_en'], 'message'=>'Booking Remainder'); - push_sent_cancel($bData['fcm_token'],$userData); + push_sent_cancel(1,$bData['fcm_token'],$userData); } } } diff --git a/application/helpers/generals_helper.php b/application/helpers/generals_helper.php index 567d6a6..0de6557 100644 --- a/application/helpers/generals_helper.php +++ b/application/helpers/generals_helper.php @@ -397,9 +397,9 @@ return $langArr; } - function push_sent_cancel($fcm_token='', $fcm_data=array()) { + function push_sent_cancel($app='1',$fcm_token='', $fcm_data=array()) { $settings = getSettings(); - $key = $settings['org_app_id']; + $key = ($app=='1')?$settings['app_id']:$settings['org_app_id']; if(empty($key) || empty($fcm_token) || empty($fcm_data)){ return; } diff --git a/application/models/Api_model.php b/application/models/Api_model.php index ccfb286..9b5e9d2 100644 --- a/application/models/Api_model.php +++ b/application/models/Api_model.php @@ -705,7 +705,7 @@ class Api_model extends CI_Model { 'title'=>'New Booking', 'param'=>'booking_id', 'message'=>'New Booking is There For Approval'); - push_sent_cancel($bkData['fcm_token'],$userData); + push_sent_cancel(2,$bkData['fcm_token'],$userData); } } } else { @@ -1423,7 +1423,7 @@ class Api_model extends CI_Model { 'title'=>'New Booking', 'param'=>'booking_id', 'message'=>'New Booking is There For Approval'); - push_sent_cancel($bkData['fcm_token'],$userData); + push_sent_cancel(2,$bkData['fcm_token'],$userData); } } $this->db->update('booking',array('status'=>$bokStatus),array('bookId'=>$book_id)); diff --git a/application/models/Organizer_model.php b/application/models/Organizer_model.php index 101bcef..ad22797 100644 --- a/application/models/Organizer_model.php +++ b/application/models/Organizer_model.php @@ -1100,7 +1100,7 @@ class Organizer_model extends CI_Model { 'param'=>'booking_id', 'title'=>'Booking Approved', 'message'=>'Your Booking is Approved by the Event Provider'); - push_sent_cancel($bData['fcm_token'],$userData); + push_sent_cancel(2,$bData['fcm_token'],$userData); $res = array('status'=>1,'message'=>'Booking Accepted Successfully'); }catch(Exception $e){ $res = array('status'=>0,'message'=>'Ohh No!! Something Went South','code'=>'ER06'); diff --git a/application/models/Webservice_model.php b/application/models/Webservice_model.php index 1af50f8..0c7f726 100644 --- a/application/models/Webservice_model.php +++ b/application/models/Webservice_model.php @@ -1215,7 +1215,7 @@ class Webservice_model extends CI_Model { 'param'=>'booking_id', 'title'=>'New Booking', 'message'=>'New Booking is There For Approval'); - push_sent_cancel($bkData['fcm_token'],$userData); + push_sent_cancel(2,$bkData['fcm_token'],$userData); } } } else { @@ -1914,7 +1914,7 @@ class Webservice_model extends CI_Model { $fcmData = array('id'=>$user_id,'param'=>'user_id', 'title'=>'Accepted Chat Request', 'message'=>$frmCustData['name'].' has Accepted Your Chat Request'); - push_sent_cancel($toCustData['fcm_token'],$fcmData); + push_sent_cancel(1,$toCustData['fcm_token'],$fcmData); } return ($status)?1:0; } @@ -1938,7 +1938,7 @@ class Webservice_model extends CI_Model { $fcmData = array('id'=>$toUser,'param'=>'user_id', 'title'=>'New Chat Request', 'message'=>'You got a New Chat Request from '.$toCustData['name']); - push_sent_cancel($frmCustData['fcm_token'],$fcmData); + push_sent_cancel(1,$frmCustData['fcm_token'],$fcmData); } else if (!empty($result) && $result['type'] == '0'){ $this->db->update('chats',array('type'=>'1'),array('chat_id'=>$result['chat_id'])); }