I have configured a Push Notifications at ServiceNow for a custom Android app. After triggering a specific event, the notification stuck in system log with "Pending" type.
Here are more details:
The user can login to custom APP on mobile device, and got registered in sys_push_notif_app_install table;
The event triggers a push notification and it is successfully written to System Log;
In system log I can see the message itself, where the registered device token is also mentioned.
Now the message remains “Pending” for specific period of time, after what turns to “failure”.
We have a Push Application configured in ServiceNow, that contains Goolge API key and “REST API” value for both Push and Feedback.
I can also see 2 error messages in System Log:
app="Push app name" origin="push.feedback"
Invalid Feedback REST Message: no thrown error
app="Push app name" origin="push.feedback" elapsed=8
exception encountered getting feedback:
java.lang.RuntimeException: feedback job does not have a valid
Feedback REST Message: com.glide.push.feedback.FeedbackClientRest.getFeedback(FeedbackClientRest.java:52)
Any ideas are highly appreciated.
I was finally able to solve it. The key point here, is to make sure the Push Application setup is correct. This is something not clearly stated in official docs. So for Android app, these points are important:
Push = Direct,
Feedback = REST,
Google API key = FCM Server Key (both leagacy and the new one are working fine).
Despite Google recommendations to set up HTTP headers for the REST message, the notifications are running fine both with- and without it. Therefore, normally you can leave out-of-the-box REST "Google Cloud Messaging Sent" unchanged.
Related
This is really a continuation of another question I posted, except now I'm using Azure's push notification telemetry and Google discontinued FCM diagnostics in the Play Console.
I get reports from users saying they haven't received notifications. But the Azure telemetry shows results like these, even for these notifications:
"GcmOutcomeCounts": {
"Outcome": {
"Name": "Success",
"Count": "1"
}
}
Crashlytics shows no crashes, so the only thing I've come up with is putting calls to a logging API in to see where it fails or stop working, but it never even reaches the app in this case.
There has to be a way of figuring out exactly where and why the notification fails. What is it?
There has to be a way of figuring out exactly where and why the notification fails. What is it?
Here is my 2 cents. In general, there can be many points of failure for notifications. Your aim would be to figure out which at which point the issue lies. Below is the diagram from the home page of FCM:
Potential failure points:
When the app sends registration token to your server.
Handling update of the FCM registration token.
If there is an error sending registration token, then you can have a
custom non-fatal exception send to Crashlytics. Since you already
seem to have the token I don't think it is the issue. However in
some cases the token might change, so just double check that
you are implementing onNewToken() and sending the new registration
token to server in case its changing.
When sending notification from your server to FCM.
When sending it from FCM to user device.
To confirm if there is no issue when sending the notification from
your server -> FCM -> user device, you can try getting a delivery
receipt from FCM as mentioned here: Receive delivery
receipts.
It says:
For Android and Chrome client apps, you can get delivery receipts (sent from FCM to your app server) when a device confirms that it received a message sent by FCM.
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, I've seen sometimes issues with firewall on the user's network, back in days when there was GCM. There could be an issue where firewall is blocking the notification. IP range of google GCM push notification server? Try opening the potential list of ports if that's the case or try testing on carrier data network. Since you mention that you've to include log at various points in the app but it never reaches. Looking into the above points can be the next steps.
Handling notification within your app / showing the notification in the notification drawer.
Hope this helps a bit in debugging your issue.
I did create a GCM account for my app to receive push notifications, now there is a new update which is mandatory for the users to download otherwise they will loos a lot of app functionalities due to server side issues.
So, when trying to send the users a notification to inform them about how important this update is, I couldn't find any way to send notifications in Google console like in Firebase console if I'm using FCM:
and upon searching, I found some tools like pushWatch, but there is no tool that can handle this huge amount of device ids, also it whole fails if there is at least one single device is already updated and can't receive it.
p.s. the update contains a new server APIkey.
There is currently no option to send messages to all your users using the FCM REST API without specifying a target (registration tokens). The option to send a message to all users is only available through the Firebase Notifications Console.
So from the comments, if all you need is a way to send messages without an App Server, you could simply send a request using Postman or cURL.
i am not receiving notification after sending it through firebase console , i tried sending many notification but received one or two from around 20 notifications, i followed this guide firebase messaging from github
,why am i not receiving notification, my app is installed in one emulator and in one of my phone but when i receive notification which i have sent through notification panel i get them either on phone or emulator never got them on both.
below is the screenshot of my console
check your android app configuration in firebase console
use a restful client to make the request, i suggest
chrome-extension://aejoelaoggembcahagimdiliamlcdmfm/dhc.html,
there you can see the response of the request, if your request are sent sucessfully or if you have error, and the response tells what kind of error you have
check android app , in the method onMessageReceived and print everything to see if you receive information, besides you can print the property "from" who is the id_number of your proyect, and you can see if the messages come from your firebase android app
check firebase documentation.
I've implemented everything just with the guides and its working pretty well
I solved the same problem.
The problem seems to be the browser compatibility/version. Mozilla Firefox could easily handle this.
Make sure your app is running in the background.
Open the Firebase notification console in the FireFox browser and send notifications.
Make sure token is generated
FirebaseInstanceId.getInstance().getToken();
in my case, the package name defined at firebase console isn't the same as defined on gradle and manifest of the app (i changed it one time in the app), so the app won't be able to receive notifications sent from firebase console.
They both have to be the same!
I did not add a new firebase project, just go to project settings at console and add new android app with another package name and have a look at the newly generated google-services.json and change some lines at you android studio project.
Besides the tips that Pavul Zavala said ، keep this in mind that just data message can received by FirebaseMessagingService even application closed or run in background and notification message can't handle(till this moment) when application run in background.
And all message that sent via FireBase console Contains , they always include a notification key
more detail at :
Push notification works incorrectly when app is on background or not running
In my case, what helped me is creating a new simulator in Android Studio
Few things to check:
in Firebase console https://console.firebase.google.com/ add/configure the project
in Android Studio connect to Firebase - Manu -> Tolls -> Firebase -> Cloud Messaging (Connect, Add FCM to your app)
Send notification from Firebase console
So, again, I recreated Virtual Device (open AVD manger and create the same device with the same API level)
I will be happy if somebody will save the time using this post :)
Ideally it shouldn't behave like that but it might be due to following reasons:
Check the notification priority of your app in the app settings of the device.
You might be sending the token of one particular device, Your target should be User segment.
I am trying to implement push notifications in Unity Android, I've completed the Quick Start and have done everything I can find out to do, but when I try to do a test push using the "Test" button on the Quick Start page, I get the message "Can't find any registered devices yet...". No errors or messages appear in the Parse logs, just this on the Quick Start page itself just below the "Test" button.
I have installations in the "Installation" table. I've even added code to my app to subscribe to channels (I've tried various names, as well as an empty string ""), and these subscriptions appear in the Installation table for those installation records.
When I go to initiate a push from the Push page on the dashboard, it correctly lists the number of devices that will be targeted by the push, but none of my devices receive anything, and it shows that 0 pushes were sent. And I keep receiving the "Can't find any registered devices yet..." message on the Quick Start page.
I even tried building the Push sample app, found some things wrong with it which prevented it from even running on the device, but I cannot get it to even register an installation, much less receive a push notification.
I have been working on this for over a week now, and I'm desperate for some help. I really need to know the reasons why Parse would be reporting there are no registered devices despite the presence of installations.
Details:
Parse 1.6.0
Unity 5.1.0.f3
I am using Uniqush to send GCM messages to an app I'm developing, and so far this is working well. However, for obvious reasons I am uninstalling and reinstalling the app as I develop, and it's re-registering for GCM with each new install.
I understand GCM is supposed to handle this automatically:
http://developer.android.com/guide/google/gcm/adv.html#unreg
if a message can't be delivered to a device, it sends an error to the server, which handles it. Unfortunately (even after sending a test push message while the app wasn't installed) I am getting duplicate messages to my device.
Is this a failure in Uniqush, my program, GCM, or some combination of the three?
If notifications are sent to a device while it has the app uninstalled, eventually the duplicates clear.
Given your description, I am unable to reproduce your situation. Here are the steps to try to reproduce it:
Install the test app on my phone and push notification to it using uniqush. Correct. Uniqush's log shows it is successfully delivered and my phone shows the correct result.
Uninstall the test app.
push another notification again using uniqush. Uniqush's log shows the message saying the user is unsubscribed the service: [Unsubscribe][Info] 2012/12/21 19:18:08 [UnsubscribeRequest] RequestId=3992a14e4987e94e3ce16bb7394ee06d2d9e7231 Success
DeliveryPoint=gcm:47e6551857be173b1418e56b63dbdb8cd58c94a2
Then push one more notification to the device, uniqush says it cannot find the device (because it has already been removed.)
Check the database using redis-cli, the device's information is no longer stored. It is successfully unsubscribed.
However, I did found some problem: if you check the error message returned from uniqush from HTTP, then you will see Success on the second notification. I have already fixed this bug in next release. It will be online soon. (If you are interested in that, check the .deb package )
In fact, uniqush is designed to be able to handle such situation so that the user don't need to care about unsubscription, device token/registration id update, etc.
If you have any future question, please feel free to comment or contact me.