I've implemented Firebase Push Notifications using Admin SDK for both android and iOS. In iOS i'm receiving notifications on all the stages (Foreground, background or even terminated), but in android I need to integrate Local Notifications again for receiving when app is in foreground. Even I'm successfully integrated it. I need to maintain single notification for particular user. I'm using TAG field while generating Push Notifications whereas in the frontend even i provide the same tag its generating a new notification. So I've added tag as notification_id by converting it to HASHCODE. Now I'm receiving unique notifications using Local Notifications as well.
My problem i'm facing is
For instance consider when my app is in foreground I've generated notification using Local Notifications Package. In the next minute I went to background so I've generated Notification using firebase SDK. In this case I'm seeing 2 Different Notifications for the Same User. One from Local and another from Firebase. In need to maintain single notification for particular user.Can anyone guide to how to solve this.
Related
I am using the Firebase Cloud MessagingPush notification service to send notifications in flutter but I want to send notifications at a specific time like a reminder for a meeting through push notification I just want to know how can I achieve using Firebase Cloud Messaging or any other push notification service provider.
I already used flutter local_push_notification but the problem is notification is not showing at terminated state but it is working on the background and foreground state.
is there any method is available that I can use on my server where all my API is presently saved, which I using to call in a flutter.
You can use firebase cloud functions. You should send notifications at the moment you want with cloud functions and problem should be solved.
Here is the docs.
I have developed a game with unity and I have used 'Firebase Cloud Messaging' for push notification.
I have one problem. when I clear the received notification in tray, it seems like the message related to it is also deleted. so 'MessageReceived' is not called when I open the app.
I experienced this problem on android. Haven't tested it on ios yet.
I use firebase admin sdk for sending messages.(written with node js)
is there a way to clear notification tray without deleting the message?
thanks for any help in advance
There is some extra setup required to route notifications when the app is not running on Android.
See the Firebase docs for more information
Quote from documentation:
When the app is not running at all and a user taps on a notification, the message is not, by default, routed through FCM's built in callbacks. In this case, message payloads are received through an Intent used to start the application.
Messages received while the app is in the background have the content of their notification field used to populate the system tray notification, but that notification content will not be communicated to FCM. That is, FirebaseMessage.Notification will be a null.
Basically you need to use the custom launch activity bundled with Firebase Messaging instead of the default UnityPlayerActivity. This activity is called MessagingUnityPlayerActivity can can be found inside libmessaging_unity_player_activity.jar. You'll need to create a AndroidManifest.xml file to instruct the app to use this custom activity instead of the default Unity one.
I have developed a chat app using Xamarin, and the app receives push notification when a new chat arrives. The push notifications are delivered through OneSignal platform which uses Firebase for Android and APNS for iOS.
I would like to unsubscribe for push notification from the device itself when a user logouts, so that even if the server sends one, it wont be displayed. I can achieve this in iOS with the following code.
UIApplication.SharedApplication.UnregisterForRemoteNotifications();
What would be the equivalent for this in Android. I have searched a lot in documentation but no luck. Appreciate some help. Even it someone can tell the code in Java or Kotlin, that would do.
In Android you must delete that instance Id to avoid receiving push notifications but also disable auto init so that it doesn't generate a new token registration:
FirebaseMessaging.Instance.AutoInitEnabled = false;
FirebaseInstanceId.Instance.DeleteInstanceId();
I'm developing a communication app using Phonegap framework wherein the concept of notification has just came into picture. The app should notify the end user about the new message/event occurring in the app.
1) So my question is for these kind of notifications which type of notifications should be used is it local ? or is it remote/push ?. I came across local notification plugins for phonegap and at the same time i even went through parse.com but confused in what to use.
2)Another question which is running across my mind is for push notifications we need to generate APN's (Apple Push Notification certificate), do we need to generate APN certificate for local notifications as well...?
Please do the needful..
1. So my question is for these kind of notifications which type of notifications should be used is it local ? or is it remote/push?
As your backend needs to notify to the user when a new message/event occurs, so you will have to use remote notifications (Push notifications)
2. Do we need to generate APN certificate for local notifications as well...?
No we don't need, generating APNS certificate is only required for remote notifications in iOS
"I came across local notification plugins for phonegap and at the
same time i even went through parse.com but confused in what to use.".
Push Notification is the best way for a communication app like all the notifications i get from my Facebook app that's push notification.
So you can write a script that notifies your users for new updates.
"do we need to generate APN certificate for local notifications as
well...?"
No you don't... Local Notifications are offline reminders e.g for scheduling an appointment or an alarm (Which you don't need internet for).
I have an Event management solution with web and mobile app (for both android and ios).
I am using Phonegap 2.7 for mobile app.
In my mobile app, I'm just displaying the data that is created and updated using web solution. I have a list of "Tasks" and "On-Site Tasks" in the mobile app with Date and Time and have scheduled local notifications for all the items using Phonegap's local notification plugin. The notifications are working as expected and I am recieving them on time.
But when the data is updated using web solution I have to reschedule the local notification on device and for this I have to launch the app every time I want to update the previously scheduled notifications.
My question is, Is there a way to update the local notifications whenever the data is updated on web solution without launching the app ??
I want the local notifications to be updated automatically when the data is updated from web solution.
iOS dev here, I don't know Phonegap nor do I know Android. But in general for iOS:
You need to use push notifications instead. The purpose of local notifications is to maintain them completely client-side. If the notification depends on server-side state, and you do not want to launch the app to update notifications, you need to dispatch the notifications using push.
https://en.wikipedia.org/wiki/Apple_Push_Notification_Service
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW9