FCM and local notifications on iOS

Hi there,
As i recently discovered, the fcm-plugins and the local-notifications-plugin dont work well together on current iOS versions.
If i have cordova-plugin-fcm and cordova-plugin-local-notification installed at the same time, the fcm notifications arent recieved in foreground.

This is, what i want to achieve:

  • App is in foreground and data-notification comes in -> raise local notification
  • App is in background and data-notification comes in -> raise local notification
  • App is not running at all and data-notification comes in -> raise local notification

As far as i know at the moment, the last topic is not possible with ionic/cordova and the available plugins.

Bu if i somehow could achieve the first two topics i would be satisfied.
Is there someone, wo got the first to topics to work on a current project?

Thank you
Skee

1 Like

The same situation and problem! Please help!

Send a notification to your own token using FCM to simulate a local notification.

It’s not help with scheduled notifications (for that we use local-notification)

I have found solution.
This problem occurred when cordova-plugin-local-notifications v0.9.* installed.

I have downgrade to 0.8.5 version - now FCM work and Local Notofications work.
To do this you need remove current ordova-plugin-local-notifications and add plugin from git:
https://github.com/katzer/cordova-plugin-local-notifications.git#0.8.5

I have create issue on cordova-plugin-local-notifications git repository. Please vote for this issue or comment to attract the attention of the plugin author

I have found now solution. I hope it helps for you.

I have installed the lates version of plugin:
“cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications.git#0.9.0-beta.3

And reinstall fcm plugin.

Now fcm and local notifications work correctly on iOS and Android

1 Like

Hmm, i tried this before, didnt work. Maybe i have to give it another try…

I did so many changes for this day.
I have installed 0.8.4, 0.8.5, 0.9-b2, and now 0.9-b3. I don’t know what operation solve the problem :((
it’s very annoying

But this is the lates my config.xml:

<engine name="android" spec="^6.3.0" />
    <engine name="ios" spec="^4.5.4" />
    <engine name="browser" spec="5.0.3" />
    <plugin name="cordova-plugin-splashscreen" spec="^4.1.0" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
    <plugin name="cordova-sqlite-storage" spec="^2.2.1" />
    <plugin name="cordova-plugin-badge" spec="^0.8.7" />
    <plugin name="phonegap-plugin-push" spec="^2.2.1">
        <variable name="FCM_VERSION" value="11.0.1" />
    </plugin>
    <plugin name="cordova-plugin-screen-orientation" spec="^2.0.2" />
    <plugin name="cordova-plugin-insomnia" spec="^4.3.0" />
    <plugin name="cordova-plugin-flurryanalytics" spec="^1.4.6" />
    <plugin name="cordova-plugin-app-version" spec="^0.1.9" />
    <plugin name="cordova-plugin-inappbrowser" spec="^2.0.2" />
    <plugin name="cordova-plugin-x-socialsharing" spec="^5.3.2" />
    <plugin name="cordova-plugin-device" spec="^1.1.7" />
    <plugin name="cordova-plugin-statusbar" spec="^2.4.1" />
    <plugin name="cordova-plugin-globalization" spec="^1.0.9" />
    <plugin name="cordova-plugin-taptic-engine" spec="^2.1.0" />
    <plugin name="cordova-plugin-inapppurchase" spec="^1.2.0" />
    <plugin name="cordova-clipboard" spec="^1.1.1" />
    <plugin name="cordova-plugin-ionic-webview" spec="^1.1.19" />
    <plugin name="cordova-plugin-fcm" spec="^2.1.2" />
    <plugin name="cordova-plugin-local-notification" spec="git+https://github.com/katzer/cordova-plugin-local-notifications.git#0.9.0-beta.3" />

You can achieve the third point by using Ionic Native Push.