Hi Eddie, to make things easier (hopefully) I'm going to share my screens and settings (in order to share a screen you have to add it in the Attachments tab below)
There is another very important aspect to look at which is the routine used to actually send the notification. Below is the code I'm using, please take special note of the changed made at the end replacing "gcm" by "fcm"
Code: Select all
command pushNotificationAndroid pAPIKey, pDevices, pTitle, pBody, pBadge, pSound, pPayload
local tDataA, tNotificationA, tNotification, tHeaders
# build data element of notification
put pTitle into tDataA["title"]
put pBody into tDataA["body"]
put pBadge into tDataA["badge_value"]
put pSound = true into tDataA["play_sound"]
put pPayload into tDataA["payload"]
# build notification
put tDataA into tNotificationA["data"]
split pDevices with LF
put pDevices into tNotificationA["registration_ids"]
put "Splash21" into tNotificationA["collapse_key"]
# create a JSON encoded message
jsonEncode tNotificationA, tNotification
# headers
put "Content-Type: application/json" & LF into tHeaders
put "Authorization: key=" & pAPIKey & LF after tHeaders
set the HTTPHeaders to tHeaders
# had a couple of errors that were resolved by setting/resetting this flag :/
libUrlSetSSLVerification false
# send the notification
# URL updated on 19 Feb 2018
# changed by me on Aug 09 because the gcm call has been depreciated
--post tNotification to url "https://gcm-http.googleapis.com/gcm/send"
post tNotification to url "https://fcm.googleapis.com/fcm/send"
return it
end pushNotificationAndroid
My senderID is a 11 digit number and i read on previously it should be 12?
Mine is a 12 digit number...
Can i also check do your server key has a semi colon at the start of the string?
Mine doesn't have a semi colon at the start...it looks like
AAAAzNoik....0KKQyxY5
Hope it helps...best luck!