I’m currently using GameSparks for one of my new apps and now I want to add notification to it as well. I followed the instruction on the plugin page (https://docs.coronalabs.com/guide/events/appNotification/index.html) and all works fine till that point. I can send a notification from Firebase and it is received on the device.
To also make it work in combination with GameSparks i have to make a call (PushRegistrationRequest) where i have to provide the push registration id/token.
I was not able to find how to get this value in the documentation and Google searches did also not give me the answer, only results for the old notification plugin.
It seems it was possible with the old notification plugin (GCM) using below code but in the notification v2 it will not return anything
local googleRegistrationId = nil local function onNotification(event) if event.type == "remoteRegistration" then -- This device has just been registered for Google Cloud Messaging (GCM) push notifications. -- Store the Registration ID that was assigned to this application by Google. googleRegistrationId = event.token -- Display a message indicating that registration was successful. local message = "This app has successfully registered for Google push notifications." native.showAlert("Information", message, { "OK" }) else -- A push notification has just been received. Print it to the log. end end -- Set up a notification listener. Runtime:addEventListener("notification", onNotification)
Is there a way to get this working?
Thanks in advance,