Hi Brent,
I am using “plugin.notifications.v2” and testing on an iPhone device.
Here is my config.lua :
application = { content = { width = 320, height = 480, scale = "letterbox", }, application = { notification = { google = { projectNumber = "594235633861", }, iphone = { types = { "badge", "sound", "alert" }, }, }, }, }
and my main.lua :
local notifications = require( "plugin.notifications.v2" ) local deviceToken = notifications.getDeviceToken() local launchArgs = ... local function onNotification (event) if event.type == "remoteRegistration" then -- device registered deviceToken = notifications.getDeviceToken() native.showAlert("remoteRegistration", deviceToken, { "OK" }) else -- A push notification received native.showAlert("Push received", "message", { "OK" }) end end if ( launchArgs and launchArgs.notification ) then onNotification ( launchArgs.notification ) end notifications.registerForPushNotifications( { useFCM=true } ) -- Set up a notification listener. Runtime:addEventListener("notification", onNotification)