Goodmorning everyone
I’m using FCM for push notifications on IOS and android.
Everything ok for android, on IOS I just can’t.
I can’t find a tutorial to help me.
A question, when I create the IOS notification on the fire notification site of firebase, asks me to install cocoa pods, do I have to? I have already created an IOS developer certificate with push notification enabled, and I entered the .p8 key on firebase.
but when you open the APP on IOS and launch the notifications.getDeviceToken () function it returns unknown to me.
I hope someone can help me.
Thank you all
file main
local notifications = require( “plugin.notifications.v2” )
–notifications.registerForPushNotifications()
notifications.registerForPushNotifications({useFCM = true})
notifications.subscribe( “ok” )
local function notificationListener( event )
–native.showAlert(‘Event:’, event.type, {‘ok’})
myText.text = notifications.getDeviceToken()
end
Runtime:addEventListener(‘notification’, notificationListener)
file build
plugins =
{
[“plugin.notifications.v2”] =
{
publisherId = “com.coronalabs”
},
},
iphone = {
plist = {
UIStatusBarHidden = false,
UIPrerenderedIcon = true, – set to false for “shine” overlay
–UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend
UIBackgroundModes = { “remote-notification” },
FirebaseAppDelegateProxyEnabled = false,
CFBundleIconFiles =
{
“Icon.png”,
“Icon@2x.png”,
“Icon-60.png”,
“Icon-60@2x.png”,
“Icon-60@3x.png”,
“Icon-72.png”,
“Icon-72@2x.png”,
“Icon-76.png”,
“Icon-76@2x.png”,
“Icon-Small.png”,
“Icon-Small@2x.png”,
“Icon-Small@3x.png”,
“Icon-Small-40.png”,
“Icon-Small-40@2x.png”,
“Icon-Small-50.png”,
“Icon-Small-50@2x.png”,
},
}
},