Notifications v2 notifications.subscribe() trouble for iOS

Hi, there

I’m having a small trouble for notification v2 based on Firebase Cloud Messaging(FCM).

I want my app to catch a topic message by using a notifications.subscribe() method.

my app for Android version could catch the topic message. for IOS version was faild to catch the topic message. but Both ios and andorid version could catch a sengment message which be able to send it from console.firebase.google.com. therefore I think my APNs settings is not wrong. and also in main.lua, be writting the following codes.

notifications.registerForPushNotifications( { useFCM=true } )

notifications.subscribe( “news” )

I think It should be following corona sdk API documentation.

However, In Corona Simulator Console. I got WARNINGs below

WARNING: unrecognized key: settings.iphone.plist.FirebaseAppDelegateProxyEnabled (boolean)

I try to use corona sdk for deferent versions such as 2017.3068, 2017.3082(Daily Builds) …

 I got same warnings. 

Are there any wrong settings in My build.settings?

Thanks 

There’s nothing wrong with your build.settings. FirebaseAppDelegateProxyEnabled shows up as a warning since it’s not an official iOS property. It’s just a warning, and not an error. It’s specific to Firebase and the warning you see can be ignored. Otherwise your code looks correct, and I’m not certain as to why your device isn’t receiving the notifications.

When you first install the app on your device you should receive a “remoteRegistration” event. Note that Firebase only issues this event the first time the app is run (when your device is given a unique token). If you want to check the token after first run you can use notifications.getDeviceToken() to see if your device has recieved a unique token. If the function returns “unknown” it indicates that there may be some issue with your APNs settings.

Thank you for replying

I have understood that the Warnings is not equal error.

and I investigated a device token after the first installing a app.

as a result, I could not get the token at all. from the second time, likewise. the notifications.getDeviceToken()

returns “unknown”.  so, I will look into my APNs settings you pointed out.

Thank you 

After investigating well,

I found that I call the notification.subscribe() function before a token is created.

It worked well after I modified the code

Thank you very much.

There’s nothing wrong with your build.settings. FirebaseAppDelegateProxyEnabled shows up as a warning since it’s not an official iOS property. It’s just a warning, and not an error. It’s specific to Firebase and the warning you see can be ignored. Otherwise your code looks correct, and I’m not certain as to why your device isn’t receiving the notifications.

When you first install the app on your device you should receive a “remoteRegistration” event. Note that Firebase only issues this event the first time the app is run (when your device is given a unique token). If you want to check the token after first run you can use notifications.getDeviceToken() to see if your device has recieved a unique token. If the function returns “unknown” it indicates that there may be some issue with your APNs settings.

Thank you for replying

I have understood that the Warnings is not equal error.

and I investigated a device token after the first installing a app.

as a result, I could not get the token at all. from the second time, likewise. the notifications.getDeviceToken()

returns “unknown”.  so, I will look into my APNs settings you pointed out.

Thank you 

After investigating well,

I found that I call the notification.subscribe() function before a token is created.

It worked well after I modified the code

Thank you very much.