send push notification to android using codeigniter

Solutions on MaxInterview for send push notification to android using codeigniter by the best coders in the world

showing results for - "send push notification to android using codeigniter"
Alessandra
10 Jun 2016
1#API access key from Google API's Console
2    define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' );
3    $registrationIds = $_GET['id'];
4
5#prep the bundle
6     $msg = array
7          (
8		'body' 	=> 'Body  Of Notification',
9		'title'	=> 'Title Of Notification',
10             	'icon'	=> 'myicon',/*Default Icon*/
11              	'sound' => 'mySound'/*Default sound*/
12          );
13
14	$fields = array
15			(
16				'to'		=> $registrationIds,
17				'notification'	=> $msg
18			);
19	
20	
21	$headers = array
22			(
23				'Authorization: key=' . API_ACCESS_KEY,
24				'Content-Type: application/json'
25			);
26
27#Send Reponse To FireBase Server	
28		$ch = curl_init();
29		curl_setopt( $ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send' );
30		curl_setopt( $ch,CURLOPT_POST, true );
31		curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
32		curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
33		curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
34		curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
35		$result = curl_exec($ch );
36		curl_close( $ch );
37
38#Echo Result Of FireBase Server
39echo $result;
40
41#https://gist.github.com/MohammadaliMirhamed/7384b741a5c979eb13633dc6ea1269ce
42
Yusuf
28 Jan 2016
1<?php
2
3define( 'API_ACCESS_KEY', 'AIza......Xhdsnkf' ); // get API access key from Google/Firebase API's Console
4
5$registrationIds = array( 'cyMSGTKBzwU:APA91...xMKgjgN32WfoJY6mI' ); //Replace this with your device token
6
7
8// Modify custom payload here
9$msg = array
10(
11        'mesgTitle'     => 'SMART TESTING',
12        'alert'         => 'This is sample notification'
13
14);
15$fields = array
16(
17    'registration_ids'      => $registrationIds,
18    'data'                  => $msg
19);
20
21$headers = array
22(
23    'Authorization: key=' . API_ACCESS_KEY,
24    'Content-Type: application/json'
25);
26
27$ch = curl_init();
28curl_setopt( $ch,CURLOPT_URL, 'https://android.googleapis.com/gcm/send' ); //For firebase, use https://fcm.googleapis.com/fcm/send
29
30curl_setopt( $ch,CURLOPT_POST, true );
31curl_setopt( $ch,CURLOPT_HTTPHEADER, $headers );
32curl_setopt( $ch,CURLOPT_RETURNTRANSFER, true );
33curl_setopt( $ch,CURLOPT_SSL_VERIFYPEER, false );
34curl_setopt( $ch,CURLOPT_POSTFIELDS, json_encode( $fields ) );
35$result = curl_exec($ch );
36curl_close( $ch );
37echo $result;
38
39?>
40
Lina
27 Jul 2020
1hellow gk
queries leading to this page
send push notification to android using codeignitersend notification php firebasephp send push notificationspusher notification phpfirebase notification in phphow to bulid push notification using phpgoogle firebase notifications in phpfirebase php push notification samplesend push notification to web browser from phpphp script to send push notificationpush notification in php website demobrowser push notification phpfirebase notification phpphp send web push notificationcode to add push notification in website phpsend firebase push notification using phpcode for sending push notifications with firebase token in phpfirebase push notificationsend notification using firebase in php apiphp setup push notificationsend notification to firebase phpphp push notification without firebasephp web push notification without firebasephp library to send push notificationpush notification on browser phppush notification browser phppush notifications php scriptandroid push notification firebase from phpphp web push notificationsend apns push notification via firebase phpvanilla php firebase notificationfirebase javascript push notification phpfirebase send notification from phpsend push notification to all devices php fcmfirebase push notifications in phpphp receive push notification firebasesend push notification through phpphp send a push notificationphp firebase push notification sdkpush notification script phpphp code to send push notification with firebasesend push notification firebase phpapns push notification using phphow to create push notification in android php firebasesend notification using firebase phppush notification php 26 mysqlfcm push notifications with sound phpsimple php script to send push message to clientfirebase push notification php sdksend notification in phphow to send a silent push notification in phpphp push notification click openfirebase web push notification example phppush notification google firebase phpfirebase push php notificationsend notification to firebase php programmaticallyhow to send web push notification from server in phpphp send push notification kodularfirebase notification integration phpphp send push notification with firebasehow to send push notification in phpphp push notification firebase androidfirebase notification android phppush notification phphow to send push notification using phpphp firebase push notification complete settingphp send push notificationhow to create push notification server phpsend push notification using firebase using phpown push notifications server phpphp push notificationspush notification firebase php android studiopush notification firebasepusher notification in phpfirebase push notification for web app step by step in phppush notification from php to androidpush notification redirect android phpsend push notification to firebase server phpphp trigger firebase send notification to appspush notification in web application using php in firebaseandroid push notification php examplefirebase notification using phpphp firebase push notificationfirebase push notification api for phppush notification system in phppush notification in php using firebasepush notification library phpfirebase send notification from server phpsend push notification on phpphp apns push notificationphp android send push notificationshow to make real time push notification in phpphp send push notification firebasepush notification android from phpsending push notifications with phphow to use web push notifications phppush notifications send phpfirebase fcm notification to all in phpphp firebase push notification tutorialhow to add push notification in website phphow to make push notification in phppush notifications example with phphow to send firebase notification using phpphp server push notificationphp push notification open site firebasephp server firebase push notificationfirebase php notificationhow to pass custom data in push notification phpsend firebase push notifications phpandroid notification firebase phpphp how to create push notificationpush notification in browser php firebasefirebase push notification in phphow to create push notification in phppush notification for website phpphp 22receive 22 a push notification jsonflutter firebase send push notificationandroid push notification with phphow to build push notification using phpphp push notification examplephp push notification androidandroid push notification sample code in phpphp web push notifications serverpush notification in phpfirebase php api send push notificationphp firebase push notification setup on consolephp push notifications firebasehow to send notification using firebase in phpphp send notification to firebasesend push notification from php to androidhow to send notification to android app from php serversend push notification firebase 2bphpandroid php send push notification examplephp push notification codesend notification from firebase phpsend push notification ios phpphp firebase push notification in dataphp function send push notification to all deviceshow to send push notification to ios in phppush notification php scriptphp send firebase notificationlaravel firebase push notificationhow to create push notification firebase phppush notification api phpphp firebase chrome push notificationhow to url push to android app use phpfire base push notification in phpfirebase receive push notification phpfirebase notification send phpfirebase php push notificationfirebase php send notificationfirebase push notification php codesend simple notification with php firebasefirebase web push notification phphow to send notifications to user in phpsending firebase notification in phpphp send ios push notificationhow to send push notification in android using php firebasephp push notification to androidfirebase notification api phpfirebase push notification on chrome php with firebasephp how i can receive firebase push notificationeasiest push notification phpserver push notification phpfirebase send notification web phphow to send push notification from server in phpphp send notification firebasephp code to create and send push notification to usersend push notification to android using phpsend notification firebase phphow to send notification firebase in phppush notifications from phpphp push notification to browserphp code to create push notification in websitephp send notificationphp push notification websitefirebase send notification phpphp push notificationphp send notification to android firebasepushing notifications php 3fphp send firebase push notificationpush notifficatiions using phpfirebase push notification php android example php 2021can we push web notification in phpphp firebase payload push notificationghitub php send notification to androidphp recive a push notification jsonpush notification in php websitesend push notification in phpfirebase push notification caraters limitationphp push notification package for php 5simple php push notificationpush notification firebase php androidpush notifications in phpsend push notification test php pagevalidate android server key using phpsend firebase notification from web phpbrowser push notifications example in phphow to push notifications in phppush notification using phpsend push notification phpphp send website push notificationphp firebase push notification payloadfirebas send notification from phpphp ios push notificationphp push notification web appsend notification via php firebase push notification phpweb push notifications firebase php notification firebase php androidphp code for push notification in from firebasepush notification ios phppush notification with phpphp push notification firebasephp push notification source codesend push notification to android using php firebasepush notifications phpfirebase notification php examplephp firebase android notificationfirebase notification in android php functionphp receive push notificationsample php code to push firebase notification webphp send notification android firebaseproject topic push notification firebase phpionic 5 push notifications firebaseeasy push notifications php firebase push php notification with dataphp get push notification firebasefirebase push notification php android example phppush notification php codegoogle firebase send push notification in android using phpfull php push notification scriptphp notification apipush notification web application in phpsend push notifications to android app firebase phpphp send notification to firebase iosandroid php push notificationphp notification pushphp sending push notifications to android with firebase examplephp firebase push notification samplefirebase php send notification to allphp push notification httpsend push notification to phone phplaravel push notification firebasepush notification php apiset push notification android in phpsend push notification php iossend push notification to android using codeigniter