fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
623 stars 998 forks source link

Not receiving topic notifications on iOS #199

Open PatrickVanRietschoten opened 7 years ago

PatrickVanRietschoten commented 7 years ago

Hi!

So we've been trying to get FCM integration working on an ionic (cordova) app. It seems like everything is working on Android, however not on iOS.

We have the plugin up and running and published an (alpha) version to Testflight.

Working: If we send a FCM test notification via the Firebase console targeted to iOS users (no topic selection), the notification arrives. Indicating correct configuration (at least with the certifications, right?).

Not working: If we send a FCM test notifcation via the Firebase console targeted to any of the topics (all/ios/), the notification does not arrive.

Any ideas what is causing this issue?

Using: <plugin name="cordova-plugin-fcm" spec="~1.1.5" />

Thnx/Greetings!

AndroideRob-zz commented 7 years ago

Hi, I am getting the same behavior as with the Firebase Console using a payload like this:

{ "notification": { "title" : "New message", "body" : "Please respond", "click_action":"FCM_PLUGIN_ACTIVITY" }, "data" : { "url": "www.google.nl" }, "registration_ids": [ "someId", "someOtherId" ] }

This is for defined fcm_reg_ids. I guess it would work very similarly for topic messages.

timothy commented 6 years ago

I have the same result using cordova-plugin-fcm 2.1.2. When I post to the topic "all" the only recipients are android users. When I send a notification to topic "ios" none of my devices get it. The only way I have found to send notification to IOS is through the firebase console targeting the "User segment" for the IOS app.

If anyone knows of a fix or workaround please let me know. As I am hoping to use the FCM REST functionality for both IOS and Android.

Here is an example of my JSON payload when sending my post request. { "to": "/topics/all", "content_available": true, "priority": "high", "notification": { "title":"IOS Test", "body":"Notification generated using PostMan", "sound":"default", "click_action":"FCM_PLUGIN_ACTIVITY", "icon":"androidPushIcon" }, "data": { "title": "Title: test", "msg": "My test to all", "code": 2 }

jaigtz88 commented 6 years ago

@timothy did u solve it?