app.post('/GameballHooks/notification',(request,response) => {
if(verifyWebhook(request) == false) return; // malicious request
let notificationData = request.body;
/* Example: {userId:"14415233", username:"XxGamerxX", phone: "+20123456789", deviceToken: "dSvsjGMuQ5GwcAYPAqu4PW:APA91bFzRjdiTj" } */
let playerData = getPlayerData(notificationData.playerUniqueId);
// sends an SMS to your player's phone number
phoneNumber: playerData.phone,
messageTitle: notificationData.notifications[0].title,
messageContent: notificationData.notifications[0].body
// sends a Whatsapp message to your player
WhatsappHandler.sendWhatsappMessage({
phoneNumber: playerData.phone,
messageContent: notificationData.notifications[0].body
// sends a push notification
token: playerData.deviceToken,
title: notificationData.notifications[0].title,
body: notificationData.notifications[0].body