ios notification with fcm not fire on ios 11

@phpedinei

BTW. Do you receive the ‘remoteRegistration’ event on the device when you use {useFCM=true}  ?

No, nothing.

Thanks for support
 

That’s a bit strange in that case. I used my test-app for notifications, and I get a ‘remoteRegistration’ event on my device running iOS 11.

Have you registered the APN certificates in the Firebase dashboard?

Yes, I registered.

I already work with him on ios 10.

What device model are you testing on (iPad Air, iPhone 6 etc)?

if using 

{useFCM=true}

it does not enter the event

iphone 7

@ingemar_cl

In your test, it does not display the confirmation message but receives the token?

And you get notification too?
 

I tested on my iPhone 7 Plus (iOS 11) and it receives the ‘remoteRegistration’ event, and also receives notifications.

Could it be that your APN certificates have expired?

does confirmation appear to enable notification receiving?

can you share your code so I can see if I’m doing something wrong?

My certificate expires in 2018

Well, for me it does not even open the confirmation message to activate.
 

The first time I run the app the device asks for permission to receive notifications.

Subsequent runs do not ask for permission as it’s already been granted.

I simply call notifications.registerForPushNotifications( {useFCM=true})

I try a clean project:

local notifications = require(‘plugin.notifications.v2’)

notifications.registerForPushNotifications({useFCM = true})

local function notificationListener( event )

native.showAlert(‘Event:’, event.type, {‘ok’})

end

Runtime:addEventListener(‘notification’, notificationListener)

Not work

Alert and confirmation is not fired
 

local notifications = require(‘plugin.notifications.v2’)

notifications.registerForPushNotifications({useFCM = false})

local function notificationListener( event )

native.showAlert(‘Event:’, event.type, {‘ok’})

end

Runtime:addEventListener(‘notification’, notificationListener)

Works

Alert and confirmation is fired

Strange.

I copy-pasted the code above (with useFCM=true) and it works on my device.

see my build.settings

settings =
{
    corona_sdk_simulator_path = ‘/Applications/Corona/Corona Simulator.app’,
    splashScreen =
    {
        enable = false
    },
    orientation =
    {
        default = ‘portrait’,
        supported = { ‘portrait’}
    },
    
    excludeFiles =
    {
        iphone = { ‘Icon-*dpi.png’, ‘*.sketch’, ‘*.keystore’, ‘node_modules/*’ },
        android = { ‘Icon.png’, ‘Icon-Small-*.png’, ‘Icon*@2x.png’, ‘*.sketch’, ‘*.keystore’, ‘node_modules/*’},
    },
    plugins = {
         [‘plugin.utf8’] = {publisherId = ‘com.coronalabs’},
        [‘plugin.notifications.v2’] = {publisherId = ‘com.coronalabs’},
        [‘plugin.CoronaSplashControl’] = {publisherId = ‘com.coronalabs’},
        [‘plugin.facebook.v4a’] = {publisherId = ‘com.coronalabs’},
        [‘plugin.moreInfo’] = {publisherId = ‘tech.scotth’}
    },
    –
    – iOS Section
    –
    iphone =
    {        
        plist =
        {
            
            UIStatusBarHidden = false,
            UIPrerenderedIcon = true,
            CFBundleDisplayName = ‘Amo Delivery’,
            CFBundleName = ‘Amo Delivery’,
            CFBundleIdentifier = ‘delivery.amo.app’,
            UIBackgroundModes = { “remote-notification” },
            FirebaseAppDelegateProxyEnabled = false,
            ITSAppUsesNonExemptEncryption = false,
            UILaunchStoryboardName = ‘LaunchScreen’,
            UIRequiredDeviceCapabilities = {‘location-services’, ‘gps’, ‘magnetometer’},
            NSLocationWhenInUseUsageDescription = ‘Precisamos do acesso à sua localização para encontrar seu endereço’,
            CoronaWindowMovesWhenKeyboardAppears = true,
            FacebookAppID = ‘1772745452987244’,
            CFBundleURLTypes =
            {
                { CFBundleURLSchemes = { ‘fb1772745452987244’} }
            },
            NSAppTransportSecurity = {
                NSExceptionDomains = {
                    [‘fbcdn.net’] =
                    {
                        NSIncludesSubdomains = true,
                        NSExceptionRequiresForwardSecrecy = false,
                    },
                    [‘facebook.com’] =
                    {
                        NSIncludesSubdomains = true,
                        NSExceptionRequiresForwardSecrecy = false,
                    },
                    [‘api.amo.delivery’] = {
                        NSIncludesSubdomains = true,
                        NSThirdPartyExceptionAllowsInsecureHTTPLoads = true
                    },
                    [‘s3-sa-east-1.amazonaws.com’] =  {
                        NSIncludesSubdomains = true,
                        NSThirdPartyExceptionAllowsInsecureHTTPLoads = true
                    },
                    [‘googleapis.com’] =  {
                        NSIncludesSubdomains = true,
                        NSThirdPartyExceptionAllowsInsecureHTTPLoads = true
                    }
                }
            },
            LSApplicationQueriesSchemes =
            {
                ‘fb’,
                ‘fbapi’,
                ‘fbauth2’,
                ‘fb-messenger-api’,
                ‘fbshareextension’
            },
            CFBundleIconFiles =
            {
                ‘Icon-40.png’,
                ‘Icon-40@2x.png’,
                ‘Icon-40@3x.png’,
                ‘Icon-60.png’,
                ‘Icon-60@2x.png’,
                ‘Icon-72.png’,
                ‘Icon-72@2x.png’,
                ‘Icon-76.png’,
                ‘Icon-76@2x.png’,
                ‘Icon-Small-50.png’,
                ‘Icon-Small-50@2x.png’,
                ‘Icon-Small.png’,
                ‘Icon-Small@2x.png’,
                ‘Icon.png’,
                ‘Icon@2x.png’,
                ‘Icon@3x.png’,
                ‘iTunesArtwork.png’,
                ‘iTunesArtwork@2x.png’,
                ‘Icon-16.png’,
                ‘Icon-24.png’,
                ‘Icon-32.png’,
                ‘Icon-64.png’,
                ‘Icon-120.png’,
                ‘Icon-152.png’,
                ‘Icon-Small-40.png’,
                ‘Icon-Small-40@2x.png’,
                ‘Icon-60@3x.png’,
                ‘Icon-Small@3x.png’,
                ‘Icon-Small-40@3x.png’
            }
        }
    },
    
    –
    – Android Section
    –
    android =
    {
        facebookAppId = ‘1772745452987244’,
        coronaWindowMovesWhenKeyboardAppears = true,
        useGoogleServicesJson = true,
        usesPermissions =
        {
            ‘android.permission.INTERNET’,
            ‘android.permission.ACCESS_FINE_LOCATION’,
            ‘android.permission.ACCESS_COARSE_LOCATION’
        },
    },
}

 

any news @ingemar_cl

@ingemar_cl great news!

I found the problem.

The problem is when I use livebuild, it just does not trigger the push confirmation event using FCM

Not working in 2020.3601.

notifications.registerForPushNotifications({useFCM=true})

it does not trigger the confirmation message to authorise the sending notifications.

And didn’t receive Firebase Message. it works fine in Android.