add flutter

This commit is contained in:
Ariska
2026-03-11 15:29:37 +07:00
parent c253e1a370
commit 619d758027
9490 changed files with 135801 additions and 1353 deletions
+14 -2
View File
@@ -24,13 +24,25 @@ class appnotification extends CI_Controller
public function send()
{
$this->load->helper('fcm_v1_helper');
// Validate Firebase token before kirim. If no token, relogin (retry) is done in helper.
if (!fcm_v1_validate_token()) {
$this->session->set_flashdata('error', 'Firebase token tidak valid. Pastikan file ngojol-trial-firebase-adminsdk JSON ada dan dapat dibaca. Silakan coba lagi.');
redirect('appnotification/index');
return;
}
$topic = $this->input->post('topic');
$title = $this->input->post('title');
$message = $this->input->post('message');
$this->notif->send_notif($title, $message, $topic);
$this->session->set_flashdata('send', 'Notifikasi berhasil dikirim');
$ok = $this->notif->send_notif($title, $message, $topic);
if ($ok) {
$this->session->set_flashdata('send', 'Notifikasi berhasil dikirim');
} else {
$this->session->set_flashdata('error', 'Gagal mengirim notifikasi. Firebase token mungkin kedaluwarsa. Silakan coba lagi.');
}
redirect('appnotification/index');
}
}