How to make Push notification server for my android application? - java

How i can make my own push notification server for my android & ios application?
m not wanna to use GCM.

GCM and APN are the client side part of the infrastructure. You should still set up your own messaging server. That event-based server will then push messages to the clients via the proprietary infrastructure. I think applications should be respectful of their enironment, and using the push facilities of the platform is indeed a good thing for your users. Also, it should be even easier for you to implement, thanks to the standard setup and the working documentation.
Otherwise, just pick your favourite message queue middleware (Active, Zero, you name it) and integrate it directly with the native client for the supported platforms, without using GCM (or Apple push). But be warned that this will make your application less efficient, and you may face higher development costs to set up the background notification service.

Node.JS provide a module called SOCKET.IO. I use this in my android apps for live messaging. You can configure it on AWS, Digitalocean Or you can use Heroku.
Here is the good example of Socket.io with android http://nkzawa.tumblr.com/post/46850605422/connecting-to-a-socketio-server-from-android
Android chat app wit socketio
https://github.com/nkzawa/socket.io-android-chat

Related

Sending APNS notifications with Java

I am currently developing Java web services that run on WebLogic on a server. There is a requirement that I need to send push notifications to mobile devices running on iOS. I do know what is required for developing GCM/FCM for sending notifications to Andriod devices. For iOS, I know there is APNS, but what Java library can I use to send the notifications?
Also, what are the required things (registration ID, etc) needed in order to send via APNS?
Any example codes?
I have googled and found out about java-apns and javapns, but I am not even sure if they are obsolete already.
Thanks in advance.
I can help you with what all are the things which are must to implement APNS. Please note that with the introduction of new HTTP/2.0 APNS API, a lot of things have changed which used to be before. (Good news is : Things have really become easy & simple now)
Would advise you to go through the below link:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/Introduction.html
APNS Prerequisites:
1) APNS SSL Certificate, Key (Same for sandbox & production now, previously used to be different for production/development/voip etc. This is the most important step, as most of the issues related to APNS are due to the wrong certificate generation)
2) device token (specific to per iOS app running on an iOS device, your iOS client app needs to register with APNS to get this device token. Also device token is normally different for development & production environments. So please make sure your using the right token)
Once you have above mentioned certificate,key & device token for your iOS App, you can send APNS notifications from your application provider using APNS interface.
Please note that, device token can change anytime (normally during iOS software upgrade), so its always advisable to obtain fresh device token every time your app is launched.
On your query related to java library for apns, please note new APNS interface has a dependency on HTTP/2.0 . Both open source as well as enterprise versions (like AWS, Urban airship etc) are available which you can select based on your needs. Not sure if AWS supports new HTTP/2.0 interface. However its always advisable to use the latest APNS interface as per Apple guidelines.
Optionally, you can also use GCM as well to implement APNS.
https://developers.google.com/cloud-messaging/ios/start
However, your iOS app may need to register to GCM as well for the same. Basically the iOS device token will be mapped to GCM device token. However, you would still need to generate certificate,key as well as device token as I have mentioned.
I hope it answers your query.
_Ayush

Push Notifications in iOS 7> on a private server

I would like to implement a server-side push notification service for iOS.
When the application goes to the Background I need to send notifications to the client for different events and if it's necessary to wake app the application.
Currently in my system I have Apache tomcat Server and what I'm interested in to have a kind of tutorial of how that could be implemented. Is it possible to use for instance web-sockets, or what kind of alternatives such as TCP sockets from JAVA?
I have found some stand alone services such as AirNotifier, and EasyAPNs but I would prefer not make complex my configuration by including more programming languages.
Thanks

Targeting Push Notifications

I have an idea for an application and am trying to first get hold of a plan to implement it. I am planning to implement a java service on Google App Engine and this would be pushing messages to subscribers, i have a concept of channels, exactly the same thing Parse has. Unfortunately Parse is not supported on GAE and it only has an Android client.
Does GCM have channel based push notifications? Like one device can be subscribed to multiple channels and I can push messages through a channel and all subscribers of that channel alone get notifications?
Or do I have another option?
GCM does not support channel based notifications.
If you use GCM directly, you'll have to implement this functionality yourself: your server will have to manage the mapping between channels and devices (Registration IDs), and push to all the devices subscribed to a channel when you wish to push to that channel.
Note 1: this is already done, APNS and GCM. Do you have any other features in mind that this two systems do not yet provide?
GAE does not support listening sockets, which prevents building any server-to-device persistent connection push system.
Note 2: there is Channels API, but it's web only as it's wrapped in an opaque javascript wrapper and it's protocol is obscured on purpose.
Alternative 1: use an existing external service like PubNub, Pusher, Amazon SNS, etc..
Alternative 2: instead of GAE use Compute Engine, which has no such limitations. However it does not (yet) have any most of the GAE goodies: it's service APIs (datastore, queues, etc..).
Note 3: your idea of persistent connections would only work while application on device is "alive", e.g. in the foreground (at least on iOS, on Android it's possible but would severely impact battery). For universal push-to-device you would need to combine your system with platform-provided async push system (e.g. APNS and GCM).

How to implement a TAPI solution with Avaya

I currently have a working CTI integration on a Samsung phone system, within our business. Our desktop clients are running bespoke java clients which receive messages from our bespoke server application which connects to the Samsung DCS System.
We are getting a new Avaya phone system in shorty and I want to get this to work with our existing desktop client system. Therefore, I do not wish to install anything new on the desktop clients. I want to write a replacement server application that connects to the Avaya, and then uses the current message process from server to client.
Can someone please let me know what API I should be looking at to write this server based application. It must be Java based.
The two key things required are;
1. The server must be notified of all numbers ringing on all phones, so t can message the relevant client.
2. The server must be able to dial a number, on behalf of client phone, to an external number.
Any pointers in the right direction would be appreciated.
The API you need is JTAPI; you can find the documentation for it on Avaya DevConnect website: http://devconnect.avaya.com. You will need to register there but it's free.
You can also use the Avaya Device, Media, and Call Control SDK (DMCC) which is a newer, fully functional API covering media, monitoring, and advanced call control operations. See for more information https://devconnect.avaya.com/public/dyn/d_dyn.jsp?fn=353.
This API is hosted off of the Avaya Aura AE server (AES) which is deployed with Avaya Communication Manager. AES hosts a number of different API including TSAPI and Web Services. Investigate this platform and see if it meets your needs.

How to implement Beluga or WhatsApp like messaging system in Android 2.1

I am trying to develop a message app within my android app. The message will be like whatsapp and beluga. I googled it and found C2DM Android 2.2 can send the push notifications to the device. However, this is not available on Android 2.1. Anyone knows how whatsapp send the notifications for 2.1 devices?
For Android: Whatsapp is build upon C2DM and when the app opens it opens an XMPP connection to their service to deliver the messages instantly. They also might use MQTT as a protocol to minimize battery usage. That's basically it.
Edit: I learned more, Facebook uses MQTT in their messaging app. Whatsapp is build upon XMPP with their own extensions. Their server side runs on top of ejabbard (XMPP implementation in erlang). http://www.ejabberd.im/
On pre 2.1 devices WhatsApp probably keeps a connection open to their XMPP servers in the background but this is not really good for battery life.
C2DM is replaced by GCM (google cloud messaging) now . you can use it for delivering the notifications to your app . For the exchange of message one should rely on protocols like xmpp (whatsapp), mqtt(facebook messenger), mtproto (telegram) etc.
if you are looking to familiarize yourself with GCM . try out this tutorial by appsrox - Create an Instant Messaging app using Google Cloud Messaging (GCM)
they are using GCM for the message delivery as well. it won't suit for production, but its an excellent resource for people who want to develop an instant messaging android app .
I don't know what exact technology is used in whatsapp. However, if i am to implement notifications where there is no support for push notifications from the OS, i can do two things:
Poll a remote server every X seconds and check for new notifications (this is the more expensive choice).
Run a background service, maintain a connection with a remote server, which will pump me any notifications that are to be received (sort of my like my own push notification implementation).

Categories

Resources