Is it possible to send Upstream Message with Java? - java

I have my own app server which communicate with FCM server. And I have Android/iOS mobile apps working well.
I want to set a third party program using Java which send a message to FCM server repeatedly so I can keep tracking my own app server is working fine.
I tried to find a solution but official website mention about upstream message only with Android/iOS app.
Is it possible to send a upstream message to FCM server using Java?
(Or any other good idea to monitor the server? I faced the server sometimes goes down for some reason without notice it :( )

There is currently no way to send upstream messaging other than what is shown in the docs -- currently available for Android and iOS.
Even if you are able to send an upstream message, it wouldn't make sense. The flow of upstream messaging is:
Client App > FCM Server > App Server
So the result/response that you would get when sending a message, should it succeed/fail, will point out the communication between the FCM server and the Client App, not with the App Server.

Related

Configure Openfire server to support GCM push notification

I'm writing an Android chat application right now using Openfire as the xmpp server. The problem is that if I use the Xmpp server for push notification, it is fine for when user is online but it has some issues when user is offline. So is there a way to configure Openfire to let GCM to host the push notification? Is the re such thing as a GCM plugin for Openfire?
We have build an application with almost similar conditions like yours. However, for sending push to offline users we send it through server side.
In your implementation while sending message you can check if the user is offline then you can hit your server api to send push. (Also you can implement the GCM on client side too only you have to know its deviceToken or the GCM id)
XMPP manages the offline messages. So you need to handle only the pushnotification part and need not worry about saving the message.

Google Cloud Messaging Server side registration?

I have tried registering for GCM from Android and it works fine.
Is there any way I can register for GCM from server side using the gcm-server API?
The mechanic behind GCM message receiving is there is a process running in the background waiting for those messages sent from GCM server before passing to the specific app registered. In the other words, you need a platform to make GCM works or it has no way to receive a GCM message.
So the answer is no. You cannot register your server with GCM since there is no mechanic to send those message back to your server. So far there are only three platforms that support GCM: Android, iOS and Chrome.

how to secure android app and webserver communication

My android app uses GCM to send or receive text messages. At first, when a user install my app, it uses the GCM api to get a GCM_id from Google. After getting this long GCM id, app sends this id to my web server to say that this client is registered with that id.
My question is that about this step. Since firstly app gets the GCM id and sends it to my web server, I think, someone can listen the requests of the app and sends dummy GCM_ids for this client (or any other clients if guess my client id format). How can I secure this step to prevent unwanted interrupts and attacks.
While creating gcm_id, if google would send this id to my server also before sending it to client, it would be a solution to my problem. But google sends it to client only directly.
ps: Using ssl is not a solution I think. Because it can also be opened by programs like fiddler .

Retrieve last sent messages from xmpp servers after disconnect

I have created an IM app that uses asmack to connect to various xmpp protocols such as google talk and facebook.
Occasionally some messages are lost in transit (both sent and received messages) when switching between Wifi/Data or when you lose signal altogether. Is there any way to retrieve the last received messages for that particular protocol when the app manages to reconnect? I find myself having to constantly check the default messaging app to see if any messages came through while I was disconnected.
Also, how about a way to get obtain delivery confirmation upon sending a message?
Thanks!
If you use a server that supports XEP-0136: Message Archiving or XEP-0313: Message Archive Management, you'll be able to obtain all messages previously sent.
However, neither Google Talk nor Facebook Chat implements these, and afaik they have no alternative XMPP API for it either.

capture outgoing packet sent by google chat in my application

I am familiar in using xmpp library,for android i'm using asmack library.In Google chat also asmack is used.i can write an application to send/receive messages using xmpp.But now i want to track google chat messages in my application.what ever the user do in google chat the same sholud be happening in my application.Suppose that user logged in google chat,in my appication also he is logged in.Sent messages /Incomming messages also should be in sync.i m able to do every thing except synchronizing outgoing sms.How to capture the packet when user is send a message from google chat into my application. ?
You should not be able to do that (unless rooted) as it would be security issue - anyone could sniff your any network activity that way. If your app sign in to the google talk server (as any other client) then you should receive copies of all the conversations, but that's it.

Categories

Resources