I am buiding an android app which will be receiving notifications from my server. This means all my users which is above 1 million, will receive notifications from my server. I know parse and google cloud messaging(GCM) can do the push messages but please I want to know the best out of this two (parse and GCM) so I can implement it. Thanks in advance.
If you look at https://parse.com/tutorials/android-push-notifications you can see:
The Parse library provides push notifications by using Google Cloud Messaging (GCM).
So you have to register your app to GCM console to send push notification in anyway.
When to NOT use parse.com?
If you already have a backend service, you can easily implement push notification since there are plenty of third part libraries for different platforms such as node.js, php etc.
When to use parse.com?
If you don't have backend-service and you just want to send push notifications also if you don't want to spend your time by setting up server stuff then you can go with parse.com
NOTE: Facebook shuts down parse by January 2017 so please consider it.(http://blog.parse.com/announcements/moving-on/)
Android push notification is a service used to send messages directly to the Android Mobile Devices.
There are several ways we can implement Android push notification.
Google Cloud Messaging(GCM)
Parse Notification(Parse.com)
You are asking which one is the best way to implement :
The standard way is using GCM (Google Cloud Messaging) but there are some alternatives like Parse Notification,Which is easier to use.
If you need to handle Json Push messages,Refer this link
Steps involved in send Push notifications:
Developing the application involves two parts:
GCM Server Application – Create Web application using Php to send message to User via GCM Cloud server
GCM Client Application – Create Android application which receive message sent from GCM Server Web App
For More Informations regarding to GCM server and Client Application
Parse uses GCM and uses own service for Kindle
Please Go with google cloud messaging(GCM) .It is very easy to integrate in android app. the problem with parse in some case device token or registration id is not register at their database so User of parse does not get push notification.In case of GCM we can sure for device token
So my recommendation is GCM
Hope this will help you.
Related
I know how to implement GCM in my App but I don't know how to build a server able to send notification to ALL the users.
I need something quite simple (just sending notification), could you advise me any services and tutorial in order to set up the server?
I wish something not to complex, because everything that I will need from my app is receiving whether simply notifications to display or to tell the app that some new data is available for downloading.
Thank you!!
Prerequisite for GCM Application
Google API Server Key
GCM RegId of the Android Device to communicate via GCM
If you get clear concept about GCM, please visit here
If you want to use java for server side then visit my answer.
Related Links:
Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL
Android Warriors
If you're using PHP, you could use this approach to send GCM message to your client refer this
You could setup your own local server on PHP using AMPP. refer this
Probably, the simplest way is to add a cloud endpoint module refer this. Then, write a simple service refer this that sends the messages. Finally, let Android Studio deploy it.
I want to implement GCM communication in order to create push notifications, from my application server to all the devices that my app is installed via GOOGLE's servers.
I have found a library that helps me do this the Parse library and using the dashboard given I've sent a push notification from server to device and vice-versa.
The thing is that I want to be able to use the push notification (server side) from my website and not having to log in in Parse's. I'm pretty clueless about this, So I'd appreciate any direction and suggestion given
You may start with these tutorial
Using asp.net
Redth/PushSharp - A server-side library for sending Push Notifications to iOS (iPhone/iPad APNS), Android (C2DM and GCM - Google Cloud Message), Windows Phone, Windows 8, Amazon, Blackberry, and (soon) FirefoxOS devices!
Push Messages to GCM server using visual c#.net application (server side).
And using PHP and MySQL
Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL
And using Parse API
if you want to send pushnotification from parse API (not dashboard) then see
Push Notification Guide
There are docs in Parse for sending push notification from Ios,Android,.net,Javascript,php and REST services, use one them which is appropriate for you.
https://parse.com/docs/push_guide#top/JavaScript
I'm new in android development. I'm trying to develop an app in which a user can send a request to another device running the same app and it should return a response/notification to the sending device.
I googled it and found that GoogleCloudMessaging can be used for that. But all the tutorials say that it can be used to send messages from server to apps. I need to know how the reverse can be done, ie send messages from app to server..
Please provide some tutorial.
Any help is appreciated.
Thanks..
If you want to send data to your server, you can use rest communication.
Here a tutorial
Step 1: Call a server side script*(REST api/ Webserices)* from your android application using HttpPost/HttpGet,
Step 2: Wait for response coming from server and use it.
Note: don't forget send all needful data for your request from your app to server by httppost.
Go through these link this will help you.
Get started with push notifications in Mobile Services.
Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL
.
Google android doc on GCM,
Google Cloud Messaging GCM for Android and Push Notifications
I am developing android application that would receive data from server any time.i have searched in google to get some information.
1)android cloud to device messaging(C2DM).
2)persistent TCP/IP connection.
how to implement C2DM function and other one how to register C2DM?.please explain detail and send me sample application
C2DM is deprecated and you can use GCM for your requirement
Google Cloud Messaging for Android (GCM) is a service that helps developers send data from servers to their Android applications on Android devices. This could be a lightweight message telling the Android application that there is new data to be fetched from the server (for instance, a movie uploaded by a friend), or it could be a message containing up to 4kb of payload data (so apps like instant messaging can consume the message directly). The GCM service handles all aspects of queueing of messages and delivery to the target Android application running on the target device
This document describes how to write an Android application and the server-side logic, using the helper libraries (client and server) provided by GCM.
Check these links,
http://developer.android.com/guide/google/gcm/gs.html
http://developer.android.com/guide/google/gcm/demo.html
http://www.basic4ppc.com/forum/basic4android-getting-started-tutorials/19226-android-push-notification-gcm-framework-tutorial.html
http://fundroiding.wordpress.com/2012/06/29/google-cloud-messaging-for-android-gcm-simple-tutorial/
for client side app you can find the code here
https://github.com/marknutter/GCM-Cordova
c2dm is deprecated.
https://developers.google.com/android/c2dm
Maybe you'd better start with GCM
best regards
I was just looking at the new Google Cloud Messaging (GCM) and I was wondering if it is possible to use GCM for Instant Messaging on your Android application?
I saw you can send data, like a message, from a server, but is it also possible to send from one device to another one?
And how would this work?
Some example code would be really helpful..
Tnx!
The official docs on Google Cloud Messaging for Android does mention that GCM can be used to develop an instant messaging app.
...or it could be a message containing up to 4kb of payload data (so
apps like instant messaging can consume the message directly).
So we went ahead and created an instant messaging app using GCM. The server-side is powered by Google App Engine. You can read the complete tutorial here. Create an Instant Messaging app using Google Cloud Messaging (GCM)
So it is possible to use GCM for Instant Messaging on Android, to answer your question. However, reliability of GCM compared to XMPP for IM is another topic.
Just my two cents:
I think you should not use GCM for delivering IM. You should have a dedicated server where your Android IM apps will connect to, using a persistent socket connection. Your server will know who is online or not and therefore can present an 'online list' to all the apps.
GCM can come into play, while users are offline or not running your app. A GCM message can be sent to them to indicate 'XXXX wants to chat'. They can then launch your app and automatically connects to a chat session.
Google has said that the delivery of GCM messages are not guaranteed. This reason alone is not a good idea to rely on them for Instant Messaging.
Try pub nub - it is pretty easy to implement - send Im from one mobile to another - simply fire up the web page (see link) in the browser , and chat between pc, mobile - and works - with 'no server'. Code is for javascript but they also have java. Chat app using jquerymobile web app framework
You might want to check out how a server sends a message to the GCM Service. It is possible to use php on Server side so it should be possible to adapt that to a POST request directly out of your application. However, to communicate you need the registered ids of the devices you want to send data to. Means you will need something to store and get them. Best solution would be your own (web) server which stores all ids and handles the Message sending.