Android- Listening and interpreting which app sent notification? - android-notifications

I'm building an android app which listens to notifications and has to figure out which app (Facebook, whatsapp, mail, etc.) the notification belongs to.
I know how to listen to the notification using NotificationListenerService.
But how do I figure out which app sent this notification?

Related

How to Test FCM Data Push Notifications Delivery?

I have an Azure Web Service which is using an Azure Notification Hub to push data notifications using FCM via Firebase to a Xamarin Android App. Initially the app is getting a token which is posted to the web service. The web service then sends it with the data to the notification hub which is sending it to Firebase. The response back from the hub is indicating a successful transfer it seems from the notification properties and the ReqID property. But the notification is not reaching the app. Is there a way to see individual notifications' status on the Firebase site? Currently I don't see anything under the "Cloud" report for Data.
[
Thanks for asking question! One of the notification failure point could be when sending it from FCM to user device. To confirm this, you may try getting a delivery receipt from FCM.
You may refer to this article Receive delivery receipts. It says for Android and Chrome client apps, you can get delivery receipts which can be sent from FCM to your app server. To enable this feature, the message your app server sends to FCM must include the field delivery_receipt_requested. When this field is set to true, FCM sends a delivery receipt when a device confirms that it received a particular message. Also check for firewall on the user's network.

background push notification in ionic3

I have completed an e-commerce app in ionic3. The problem is I want user to be notified when new offers or deals are added in our inventory. This should be a backend process, whether or not the app is open or close.
Note: There is no firebase involved.
If you want to use to get notification in same device then you can try Local notification native plugin for notification and if you want to send notification to other device then you have to use Push or FCM or Onesignal and yes this all required firebase to send push notification to generate device id/key.

Flutter FCM Push Notification Not Working when app is in foreground

I am sending push notifications using Flutter's firebase_messaging package and I send them in the firebase console. When the app is in the background or when it is closed, I am receiving the notifications, however, when the app is in the foreground it is not working. Please tell me if I need to integrate Javascript to make this feature work, and please reference a resource that I can use in order to figure out how I can integrate Javascript with fcm as I haven't found a way to do this with flutter.
I figured out that someone can use the flutter local notifications plugin so that when the push notification is sent and the app is on the foreground, normally no notification would be delivered to the system tray, but using the flutter local notifications plugin, it would be possible to send a local notification when the app is on the foreground.
To Understand better.
Have a look into this table.
https://pub.dev/packages/firebase_messaging#receiving-messages
It states that when your Android or iOS Application is in foreground, OnMessage callback is called if you are sending notification payload or data payload as notification body.
You are receiving notifications when your app is in background because, when an app is in background notification is send to system tray and OS (Android or iOS) handle it for you. And your app is launched when you click on notification from system tray.
When your app is in foreground you have to catch notification payload in onMessage and handle it explicitly, you can create local notification in this case.

GCM: Message sent on a topic does not reach the browser

My setup include a webapp, a backend server and an android app.
I want to be able to chat between my android app and webapp.
Init:
Android app has subscribed to the topic /topics/chatGroupName
Similarly on browser, I get the registrationToken and send it to my server where I use code similar in https://github.com/ToothlessGear/node-gcm/pull/211/files (addToTopicNoRetry) to subscribe the browser to the topic: /topics/chatGroupName
When I send a message from the web, I use my backend server to send a GCM message on a topic like /topics/chatGroupName and the android app receives this message.
But when I send GCM message from Android app on this topic /topics/chatGroupName, I dont get any notification on the browser app.
Even my https://iid.googleapis.com/iid/info/REGISTRATION_TOKEN?details=true shows that this registration token has already subscribed to /topics/chatGroupName
Firebase has now released javascript library that supports FCM push notifications with support for topics.
Ref: https://firebase.google.com/docs/cloud-messaging/js/client

Regarding Push Notification In Worklight?

Push Notification had been executed and worked perfectly in my
application. (I made use of worklight push notification module IBM
LINK)
There was a scenario which i experienced during the
notification received in the application android device.
The push notification is received perfectly in all the situtaion except when i am in the Login Screen(When i am in the login screen of the application the push notification is not received in my application).
Question :
Why push notification is not received in the application ?
What is the client side (Device side) architecture/execution flow , by which i can
understand when is the PushNotification Receiver (Broad Cast
Receiver) in device is ready to receive the notification and when it
can't receive notifications ?
This is the expected behavior.
You've implemented event source-based pus notifications. In this type of push notifications you must first login in order to receive notification. This is why while you're at the login screen, you will not receive the notification.
If you are using either Worklight 6.2 or MobileFirst Platform 6.3, you can use tag or broadcast-based notifications which do not require a login.
You can read more about these at the IBM MobileFirst Platform developer center.
Here is a rundown of possible scenarios:
Application is closed - notification arrives to device - by opening the application / tapping the notification in the notification bar, you will get a login screen. After you login you will actually see the payload (in the way you choose to, that's purely applicative). You will not see the actual payload, because you don't want user B for example to see the payload of user A.
Application is opened - you are logged in, but the app is in the background - notification arrives to the device - by tapping the notification or bringing the application to the foreground, because you are already logged in, you'll see the payload
Application is opened - you are NOT logged in - notification arrives to the device - you will not be able to see the payload, because you are not logged in.
Application is opened - you are logged in, and the app is in the foreground - notification arrives to the device - you will immediately see the payload (per your applicative code)

Resources