app/Controllers/Rider.php
// fungsi utk kirim notif ke aplikasi rider
fungsi utk kirim notif ke aplikasi rider
fungsi utk kirim notif ke aplikasi rider
public function sendNotifToRider($kd_driver, $pesan, $jenis = 0)
	{
		$payload = array(
			'to' => '/topics/kongVal',
			'priority' => 'high',
			"mutable_content" => true,
			'data' => array(
				"id_dr" => $kd_driver,
				"psn" => $pesan,
				"mode" => '1',
				"jenis_notif" => $jenis
			),
		);
		$headers = array(
			'Authorization:key=AAAAJrZwZQg:APA91bEp4BYq1kZcVwUyuh02a_s5F3txxf_CJHNbvdwsdjs6qwdHuWIiS3BKN7ETR3gtQkVZgHebKCH4C6N-QaHeJTEC5m8pMT0MDD5i6oG2bqPwbPT3XR3dY9h_zku1TtamNt9_Tn9q', 'Content-Type: application/json',
		);
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
		$result = curl_exec($ch);
		curl_close($ch);
	}
public function sendNotifToRider ( $ kd_driver , $ pesan , $ jenis = 0 ) { $ payload = array ( 'to' => '/topics/kongVal' , 'priority' => 'high' , " mutable_content " => true , 'data' => array ( " id_dr " => $ kd_driver , " psn " => $ pesan , " mode " => '1' , " jenis_notif " => $ jenis ) , ) ; $ headers = array ( 'Authorization:key=AAAAJrZwZQg:APA91bEp4BYq1kZcVwUyuh02a_s5F3txxf_CJHNbvdwsdjs6qwdHuWIiS3BKN7ETR3gtQkVZgHebKCH4C6N-QaHeJTEC5m8pMT0MDD5i6oG2bqPwbPT3XR3dY9h_zku1TtamNt9_Tn9q' , 'Content-Type: application/json' , ) ; $ ch = curl_init ( ) ; curl_setopt ( $ ch , CURLOPT_URL , 'https://fcm.googleapis.com/fcm/send' ) ; curl_setopt ( $ ch , CURLOPT_POST , true ) ; curl_setopt ( $ ch , CURLOPT_HTTPHEADER , $ headers ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ ch , CURLOPT_SSL_VERIFYPEER , false ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , json_encode ( $ payload ) ) ; $ result = curl_exec ( $ ch ) ; curl_close ( $ ch ) ; }
fungsi utk kirim notif ke aplikasi rider
fungsi utk kirim notif ke aplikasi rider