How can I receive the result of sending a notification to the notification bar?
up vote
0
down vote
favorite
Is there any way to know the result of the notification that we have sent using NotificationManager
?
Recently, I found an issue with my notifications because I was not using Android 8.0 channels, so many users were not receiving them: https://developer.android.com/training/notify-user/channels
However, I didn't realize the issue until I saw it myself in my phone.
Also, I am using Google Analytics to track how many users are receiving notifications. However, I couldn't see the issue this way (I has having a lot of false positives).
The code is very simple and looks like this:
private void sendNotification(int id, String title, String message, int color) {
if (userWantsToReceiveThisNotification){
Notification notification = buildNotification(); // This method now also creates a Notification Channel
notificationManager.notify(id, notification);
sendAnalyticsEvent();
}
}
What I am looking for is some kind of result to the notify
action, as it may succeed, or not, depending on user config, app config from settings, or even a wrong setup (which was my case).
What I am expecting is something like
boolean success = notificationManger.notify(id, notification);
or
notificationManger.notify(id, notification, callbackTellingSuccess);
so I can track correctly the amount of users that actually received the notification.
Thank you very much.
android notifications notify notificationmanager
add a comment |
up vote
0
down vote
favorite
Is there any way to know the result of the notification that we have sent using NotificationManager
?
Recently, I found an issue with my notifications because I was not using Android 8.0 channels, so many users were not receiving them: https://developer.android.com/training/notify-user/channels
However, I didn't realize the issue until I saw it myself in my phone.
Also, I am using Google Analytics to track how many users are receiving notifications. However, I couldn't see the issue this way (I has having a lot of false positives).
The code is very simple and looks like this:
private void sendNotification(int id, String title, String message, int color) {
if (userWantsToReceiveThisNotification){
Notification notification = buildNotification(); // This method now also creates a Notification Channel
notificationManager.notify(id, notification);
sendAnalyticsEvent();
}
}
What I am looking for is some kind of result to the notify
action, as it may succeed, or not, depending on user config, app config from settings, or even a wrong setup (which was my case).
What I am expecting is something like
boolean success = notificationManger.notify(id, notification);
or
notificationManger.notify(id, notification, callbackTellingSuccess);
so I can track correctly the amount of users that actually received the notification.
Thank you very much.
android notifications notify notificationmanager
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Is there any way to know the result of the notification that we have sent using NotificationManager
?
Recently, I found an issue with my notifications because I was not using Android 8.0 channels, so many users were not receiving them: https://developer.android.com/training/notify-user/channels
However, I didn't realize the issue until I saw it myself in my phone.
Also, I am using Google Analytics to track how many users are receiving notifications. However, I couldn't see the issue this way (I has having a lot of false positives).
The code is very simple and looks like this:
private void sendNotification(int id, String title, String message, int color) {
if (userWantsToReceiveThisNotification){
Notification notification = buildNotification(); // This method now also creates a Notification Channel
notificationManager.notify(id, notification);
sendAnalyticsEvent();
}
}
What I am looking for is some kind of result to the notify
action, as it may succeed, or not, depending on user config, app config from settings, or even a wrong setup (which was my case).
What I am expecting is something like
boolean success = notificationManger.notify(id, notification);
or
notificationManger.notify(id, notification, callbackTellingSuccess);
so I can track correctly the amount of users that actually received the notification.
Thank you very much.
android notifications notify notificationmanager
Is there any way to know the result of the notification that we have sent using NotificationManager
?
Recently, I found an issue with my notifications because I was not using Android 8.0 channels, so many users were not receiving them: https://developer.android.com/training/notify-user/channels
However, I didn't realize the issue until I saw it myself in my phone.
Also, I am using Google Analytics to track how many users are receiving notifications. However, I couldn't see the issue this way (I has having a lot of false positives).
The code is very simple and looks like this:
private void sendNotification(int id, String title, String message, int color) {
if (userWantsToReceiveThisNotification){
Notification notification = buildNotification(); // This method now also creates a Notification Channel
notificationManager.notify(id, notification);
sendAnalyticsEvent();
}
}
What I am looking for is some kind of result to the notify
action, as it may succeed, or not, depending on user config, app config from settings, or even a wrong setup (which was my case).
What I am expecting is something like
boolean success = notificationManger.notify(id, notification);
or
notificationManger.notify(id, notification, callbackTellingSuccess);
so I can track correctly the amount of users that actually received the notification.
Thank you very much.
android notifications notify notificationmanager
android notifications notify notificationmanager
asked yesterday
Javier Delgado
8621719
8621719
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238073%2fhow-can-i-receive-the-result-of-sending-a-notification-to-the-notification-bar%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password