Switcing HTTP client to CCS (XMPP) Client - android

I have a simple chat application installed on Android devices and can send notification via GCM HTTP.
I want to switch backend implementation from GCM HTTP to CCS XMPP.
Can I use same pntoken get from mobile devices registered previously to send push notification?
Is it required additional implementation at mobile device side?
I mean when I change the change the GCM connection interface from GCM HTTP to CSS XMPP Do I need to additional data from mobile devices?

No changes on device side are required. You can use same registration ids as before.

Related

Can I Customize Openfire to use as MBaaS for mobile push notification? How?

I decide to build an infrastructure to send push notification using XMPP Protocol.
I don't want to use 3rd party services like GCM or FCM [because Google restricts FCM service based on IP Address, Is there any other free Android push notification provider? ]. i don't want to use Ejabberd either because it has some cost. i have a plan to configure Openfire on my server with SQL Server so that when a message body with particular recipient(s), added to database somehow, Openfire sends those to proper client(s) [push notification to android devices].
I am developing an XMPP client on Android to connect with this server. i think it doesn't matter what platform i'm working on, anyway it's Android.
can i send message (push notification) from server to client(s) with Openfire? How?
If not, how about Prosody or other XMPP servers?
I appriciate any help

How to implement XMPP Server and communication with GCM on Android?

I am developing in Android for GCM. I want to implement like the following:
Phone Server <--> GCM Server <--> Phone Client
I have try to use Http post to the GCM Server , and the client can receive the broadcast data from Http Server.
But the client seems can not upstream the message to the Server via GCM by using Http.
So it need to use XMPP Server on Android side for receive the upstream message from Client. But it seems few information about this.
How to implement XMPP Server and communication with GCM on Android ?
Thanks in advance.
You may implement an XMPP Server through Google Cloud Messaging (GCM) Cloud Connection Server (CSS) is an XMPP endpoint that provides a persistent, asynchronous, bidirectional connection to Google servers. The connection can be used to send and receive messages between your server and your users GCM connected devices.
Implement the XMPP Connection Server can receive upstream messages from a user's device to the cloud. To initiate an upstream message, client app must send a request containing the address of the receiving app server, message data comprising the key/value pairs of the message's payload and a message ID should be unique.
Here's a useful documentation on how to Implement an XMPP Connection Server: https://developers.google.com/cloud-messaging/ccs

XMPP GCM Android implementation guidance

I have been working on GCM xmpp implementation for my chat functionality, but about a week, I am not getting online help to start with , I have got this XMPP GCM Android tutorial, but I see xmpp is not fully implemented, and upon seeing their code, it is very unclear to understand the functionality
firstly. my current structure is
Android client app for chat functionality.
java backend, app server jboss hosted in openshift cloud platform.
and according to this google gcm-xmpp image.. I see client interacts directly to gcm, which I get confused, intern gcm connects app server.
as per my implementation, I get gcm regid from gcm and send http request to app server which intern send notifications to client devices through gcm. this is reverse of what we see with gcm flow diagram
secondly, since I have already set up app server Jboss, which can handle http request for my client request other than chat functionality. now I need to implement xmpp for handling asynchronous, bidirectional, upstream messaging with another servers like openfire or ejabberd which supports xmpp.
currently I am in state where I don't know how to start with xmpp, I have got above queries, in the hope getting some directions to start with.

Difference between Cloud to Device and Device to Cloud in Google GCM

I am trying to build a chat application with the Google Cloud Messaging, something similar to whatsapp. Do i need to use 'CCS: Upstream and downstream (device-to-cloud, cloud-to-device)' OR 'GCM HTTP: Downstream only: cloud-to-device' would work just fine?
GCM HTTP is easier to use and supports Cloud to Device messaging. If all you need is for your server to notify your app when a new message is available, GCM HTTP is enough.
The Cloud Connection Server is only required if you want your app to send messages to your server via its connection to the GCM servers. It's useful if your app needs to send a lot of messages to your server.

Can you set up GCM on windows server?

I would like to use GCM (Google Cloud Messaging) and was wondering if it was possible to set it up on Windows Server (IIS) instead?
Currently my web services are all hosted on Windows Servers as WCF services. I'd like to avoid having to have a dedicated server for GCM.
Instead of what? Any server connected to the internet can be used as a sender of GCM messages. Your Android application has to be able to connect your server in order to pass the device Registration ID to it. And your server has to be able to send POST requests to https://android.googleapis.com/gcm/send in order to send the messages.
Or as stated in the GCM Documentation :
Before you can write client Android applications that use the GCM
feature, you must have an application server that meets the following
criteria:
Able to communicate with your client.
Able to fire off HTTPS requests to the GCM server.
Able to handle requests and resend them as needed, using exponential back-off.
Able to store the API key and client registration IDs. The API key is included in the header of POST requests that send messages.

Categories

Resources