I have an android application with a backend web application developed in django.
I am using django-push-notification library to enable push notification in my django backend application.
In the android application I send the registration id to the backend django application and it is stored in the DB successfully.
When I try to send the test message from the admin area, I got a confirmation that all messages are sent but I did not receive any message on my android application.
I suspected the android application but I wrote some code to test the application receiver and it worked fine, so I think the problem is in the django application.
Is there any method to make sure that the messages sent from the django app is received by the google cloud messaging service ?
I worked with GCM and django-push-notification long time ago. Although I do no clearly remember, but you can try something like:
Check the response from GCM after django send message.
Make sure that your android app use the right key for getting the message body( I remember that django-push-notification use msg key)
Related
I am new with Firebase. I want to send push notifications to an android app from a spring application. At preset I dont have an android app. I want to test whether the firebase integration is correct or not, which means I want to make sure that the push notifications sent from the backend server are recieved correctly in firebase .
How do I ensure that firebase has recieved the push notifications sent from backend server?
Is it possible to test push notifications without an android app registered on firebase? If yes, how do I do that?
I am using Firebase Admin SDK. Do I need a separate server key other than the service account key for sending notifications?
You'll get a success (or fail) response when sending messages. This means that FCM has received your message and it will try to deliver it to the users.
FCM needs to target your app in order to send notification. If you don't set up FCM SDK in your app, it wont be able to do so.
You just need to generate an auth token. This guide should help you set it up.
we created a Chat application with a Client and a Server project.
Clients can send messages to the server and the server and the server forwards it to other Clients (like a Chat application should do)
FCM is implemented in the Client project. Users can send Notifications to each other.
How can I use the Server for sending Notifications? Can I just write the Code for sending Notifications in the Server project (Server does HTTP Request with User token etc.).
Idk about that because I think the project should be somehow registered to FCM to use the services.
I only find tutorials about sending Notifications from App to App, not from Server to App.
For example in this scenario:
User installs app, then creates account and gets confirmation email from the server
, then clicks on confirmation link (app is clossed or in background)
, then gets notification that the account is ready
I think this is not possible with using FCM only in the app project
I'm very new in meteor and I just made a simple app that show news (text) for a school, the problem is that no one knows when they write something new because the app doesn't have notification. I can't figure out how to use raix:push or richsilv:cordova-notifications because the test of raix:push didn't work in my device (android) and richsilv:cordova-notifications just work with android and I couldn't make it automatic. Saying "automatic" I mean "when the mongo collection is updated a notification is sent"
I think you may need to set up push server for sending notification to Android client.
Google is providing such option, where client app has to register with GCM server. On successful registration, google will give reg Id, which has to be stored in DB.
From your server make HTTP request to GCM server with Reg Id and message. GCM will deliver the message to appropriate device.
Please refer https://developers.google.com/cloud-messaging/gcm
how to get SNS working in Android?
We have an app that sends SNS messages to iOs apps already (I personally am only working with the App side). And have extended it to send Android messages. It works fine for iOS and thinks it is sending to Android correctly but no message ever actually shows up on the Android device.
I am registering with the backend by getting the Settings.Secure.ANDROID_ID and sending that to the web service that registers it with Amazon SNS.
I have turned on all the permissions that I can (I don't need to specifically ask for permission do I?, how would I do that).
Basically the setup we have is I hand our web service a device id and it registers with Amazon and the web service sends the notifications out (but I am never seeing them).
Is there anything else I need to do or check on the client side?
Amazon SNS for push messaging on android instructions is the same as normal GCM on android.
You must follow the directions here:
GCM Getting Started - covers the google console set up and will provide you with the :
SenderId, for use in the android app code. (This is the Google Console's Project #)
the api key, for use in SNS server setup
Implementing GCM Client - covers client library, getting the registration ID, setting up a wakeful service and broadcast receiver for creating notifications or whatever you'd like you app to do when it receives a push.
You should also read thru amazon's documentation Getting Started with Google Cloud Messaging for Android which summarizes the the previous two links.
I am registering with the backend by getting the Settings.Secure.ANDROID_ID and sending that to the web service that registers it with Amazon SNS.
This is not correct. By using the GCM client library, call the following methods to get the real registration ID (sns likes to call them an endpoint) that you can send to the web service that registers it with Amazon SNS. There should be no need to use Settings.Secure.ANDROID_ID at all for push on android.
GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(someContext);
String registrationId = gcm.register(senderId);
I have turned on all the permissions that I can (I don't need to specifically ask for permission do I?, how would I do that).
see Implementing GCM Client for the required permissions that you must include in your AndroidManifest.xml. And no, you don't need to specifically ask for permission since it would be in the AndroidManifest.xml but you could ask the user on first app start with a dialog or some other UI. You may also choose to let the user disable push for you app via a settings screen if your app has one.
Is there anything else I need to do or check on the client side?
You should confirm that you are able to get registration ids (perhaps some logging)?
And then with those ids, test your implementation. Here is a question that was asked a while ago that will help you use a rest client to send pushes with your registration ids and api_key (SNS login not needed).
How to push notification from rest client for testing purpose
I read about Google Cloud Messaging at http://developer.android.com/google/gcm/gcm.html.
It supports Third Party Application server to Android application push notification.
I am wondering whether it is possible to implement the same thing push/receive notification from an Android app on one mobile to the same Android app on another mobile using Google Cloud Messaging.
If not, is there any other free service available similar to Google Cloud Messaging?
An Android device can send a GCM message to another Android device. All it needs is the API Key (of the Google API Project ID that the app uses to register to GCM) an the Registration ID of the other device. Using these parameters it can send a GCM message to another device via an HTTP request.
Usually applications that use GCM require a 3rd party server in order to store the Registration IDs of all registered devices. If your app has a different way to let devices share their Registration IDs with each other without requiring a server, you don't need the server.
As far as I'm aware, there has to be a server in the middle to send the push notifications (Android -> Personal Server -> GCM Server -> Android)
So the Android device sending the notification would send some data to a script on the server (using a HTTP GET/POST), and that script would then send the push notifications to all the devices that you wanted it to
Following the example Code from google (GCM Client Example), you can build an app to get a registration ID for your device, but sending messages without a server wouldn't work in my opinion. I didn't tried by now, but what about using the Google Backend Starter, or (what I tried) using a Backend as a Service Provider like apiOmat if you can't afford or don't want to set up a server.