GCM for sending notifications on android mobile app from Salesforce - android

We are trying to send the notification to an Android App about any event generated in salesfoece(Like creating an account), using the Google's GCM(Google Cloud Messaging).
Here is the link that tell about the GCM ,
http://developer.android.com/guide/google/gcm/gs.html#android-app
I m using Eclipse for creating Android App and my GCM server gave me the SenderID and API key.
But the problem is , How can I use Salesforce as my 3rd Party Application,from where the notifications are generated.

Starting with the Spring 14 release, Salesforce supports Google ( GCM ) and Apple ( APNS ) mobile push notifications via the Connected Apps framework. Please check the Mobile Push Notifications Tip Sheet on Developer Force for more information: http://www2.developerforce.com/en/mobile/resources

You will likely need to monitor the API for events from salesforce by polling; otherwise you might be able to get events sent to a specific URL. I'm not positive that you can specifically send a push notification from salesforce itself.
However, with your application you should be able to build in some middleware to handle that.

Related

Android Notifications Techniques

I am developing an server based Android app in which i have to notify user. Please suggest me some techniques to do this. How do Whatsapp, Facebook notifies the user?
As a suggestion , you need
Server to run web application
web application to register and send notifications to devices where your app installed.
client / server keys registered with Google Cloud Messaging API
to perform this

Apple push notifications on GCM

I'm trying to create application for Android and iOS and, i want to use push notification on both the application. I'm going to have a server app that will be sending the notification.
but i am trying to APNS and Parse SDK it's common to use ,but i want GCM through push notifications on iOS ,can you please how can it possible ,any such information about GCM to iOS push notifications ,i am googling but i want some suggestions for GCM through iOS device notifications.Can you help me.thank you.
There is very good descriptive instructions in Google Cloud Messaging for iOS guide. It shows whole flow from registration of device token to receive push from server with code example.
After go through above guide, you may go for Setting up a GCM Client App on iOS and you are almost done to use GCM with iOS application
Update: GCM now supports IOS. See Grigo´s comment.
GCM is Android specific. If you want to avoid dealing with 2 different services for IOS and Android, you can use something like Amazon SNS for example. SNS now supports pushing cloud notifications to Android, IOS and Windows devices via the AWS Mobile SDK.

implementing GCM communication

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

Is Google Cloud Messaging from Android to Android possible?

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.

Instant Messaging on Android with Google Cloud Messaging

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.

Categories

Resources