ok
Direktori : /home2/selectio/www/y1jobportal.in/notification/ |
Current File : /home2/selectio/www/y1jobportal.in/notification/send-push.php |
<?php require_once('firebase.php'); require_once ('push.php'); require_once ('../admin/api/config/config.php'); $type="default"; $id="0"; $push = new Push( "Ganesan New", "Back End Testing Message Confirmation", "https://lh6.googleusercontent.com/proxy/weaptgZW2fI5xpQ8yDMou1dhMzFOsIqQnlG8ZdVQveK9h7r5bCmFpkwjBQfMb_AsgSMf5ZCtYoNaXWY3Ma1IyVw9oKHNqGzoioXYA-Ho92P3L-xiO3nLPWp8O1ntjt3c9gc", $type, $id ); //getting the push from push object $mPushNotification = $push->getPush(); $devicetoken = array(); $statement = $pdo->prepare("SELECT fcm_id FROM `customer` WHERE fcm_id!=''"); $statement->execute(); $result = $statement->fetchAll(PDO::FETCH_ASSOC); $totalrow = $statement->rowCount(); foreach($result as $r){ array_push($devicetoken, $r['fcm_id']); } $devicetoken_chunks = array_chunk($devicetoken,1000); foreach($devicetoken_chunks as $devicetokens){ //creating firebase class object $firebase = new Firebase(); //sending push notification and displaying result $result= $firebase->send($devicetokens, $mPushNotification); print_r($result); } ?>