This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Async await func | |
async function getTimelineData() { | |
var response = await fetch('/some-api-url') | |
return response.json() | |
} | |
async function populateTimelineInit() { | |
var data = await getTimelineData(); | |
new vis.DataSet(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PushNotifications{ | |
private static $API_ACCESS_KEY = "YOUR_FCM_SERVER_KEY "; | |
public function __construct() { | |
// exit('Init function is not allowed'); | |
} | |
public function android($data, $reg_id) { | |
$url = 'https://fcm.googleapis.com/fcm/send'; | |
$message = array | |
( | |
'title' => $data['mtitle'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
#API access key from Google API's Console | |
define( 'API_ACCESS_KEY', 'YOUR-SERVER-API-ACCESS-KEY-GOES-HERE' ); | |
$registrationIds = $_GET['id']; | |
#prep the bundle | |
$msg = array | |
( | |
'body' => 'Body Of Notification', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Server file | |
class PushNotifications { | |
// (Android)API access key from Google API's Console. | |
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI'; | |
// (iOS) Private key's passphrase. | |
private static $passphrase = 'joashp'; | |
// (Windows Phone 8) The name of our push channel. | |
private static $channelName = "joashp"; |