user8424883
user8424883

Reputation:

Facing issue when implementing Push notification in ionic and queries related to this issue

I am developing a hybrid app in ionic where push notification is necessary to notify users about their tasks. So to achieve this functionality I am using cordova-plugin-fcm-with-dependency-updated by use of this plugin I am able to get a notification when the app(in android) is in the background state. I am not able to get the notification in a foreground state or killed state of the app (in android). While searching about this issue I found a blog where the author has described this problem why this happened and all. So my queries related to this issue are

  1. Should I use OneSignal and push plugin over FCM push notification?
  2. How can I implement the FCM plugin to receive a notification while the app is in the killed state?
  3. Which is the best plugin to implement?
  4. If I go with OneSignal push notification will I get the notification in all state of the app for all devices(ios, android, and web).When one signal has described notification not show condition while the app is force stopped?
  5. How can I handle this notification services if data is off?
  6. How can I handle this notification services if the user phone is switched off and the user switched on their phone after a time period?

Please help me.

Upvotes: 0

Views: 142

Answers (1)

Ankit Kumar Singh
Ankit Kumar Singh

Reputation: 557

I have faced the similar issue few months back, so I can help you in this regard.

One Signal is covering a very limited domain. So to overcome these issues I personally started using cordova-plugin-firebase plugin which solves all these issues and the maintainer are also very active.

So coming to your questions:

  1. Should I use OneSignal and push plugin over FCM push notification?

    • Prefer using FCM since the firebase team is very actively working on improving the product.
  2. How can I implement the FCM plugin to receive a notification while the app is in the killed state?

    • FCM takes care of this thing all you need to do is pass a flag, refer [this][1] blog.
  3. Which is the best plugin to implement?

    • Firebase
  4. If I go with OneSignal push notification will I get the notification in all state of the app for all devices(ios, android, and web).When one signal has described notification not show condition while the app is force stopped?

    • Firebase did cover all the platforms, and covers all the states.
  5. How can I handle this notification services if data is off?

    • If the data is off, I believe firebase does hold these notifications in some buffer and retries once the data is gets active. But not so sure about it.
  6. How can I handle this notification services if the user phone is switched off and the user switched on their phone after a time period?

    • Refer answer 5

I hope I have covered all your doubts.

Happy Coding.

Upvotes: 0

Related Questions