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
Related
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
I had before a project where i need to push data(websocket) to the client i used spring and atmosphere framework(an abstract of websocket in java). But finally i think actually websocket app in java are not enough good since i used nodejs&socket.io for an another project. It was so easy and a great experience to code an push data api.
So now i am thinking about an architecture and i want to share with you to know if its a good practices.
I have my server spring, client and nodejs/socket.io. I want to use nodejs just to store de socket and push event.
So imagine the server has to push data to specific users i will call a service in nodejs and he will push it.
So the nodejs API will just redirect requests to a user, nothing more.
Is that a good practice ?
Thanks for your idea
I would advice you decouple java application server and nodejs (socket server) and communicate using a middleware (messaging system..)
Let's say your java application is running on http://abc.com:1234 and socket.io on http://abc.com:5678. Then when the page is opened you can subscribe of the socket server.
Once you have some data to push, put it on middleware. SocketIO server will pick it up from there and pushes to all the browser client subscribed.
I have a little question about an android app with a function "remote" use via internet.
So I have these ideas:
Create a webservice using php on the server, and refresh the client app all x time like 4-5 sec
Or make a java server (so I don't know how I can do that)
I just want make a remote connected via user/password to the server and the other app connect to the server and refresh his status.
Do you know the best way for do that?
Thanks
The question is not very precise, but as far as I understand it, both your ideas implement the 'pull' concept, that is the client app checking the status of the server every now and then.
If you want the app to be instantly notified of the server status change, I would suggest push notifications with GCM (Google Clound Messaging). You can find some basic descriptions and examples at: http://developer.android.com/google/gcm/index.html
Sending a server-to-client notification is simple regardless of the platform you use server side. E.g. for PHP integration with GCM, check out this thread: GCM with PHP (Google Cloud Messaging)
Recently i developed a simple chat application in java using sockets. It was working fine. But now i want to make an application which can communicate over the Local Area Networks like IPMSG. The features will be
message sending.
file sending.
voice chat.
group chat.
encryption/decryption on demand.
These were the basic features to be included.
Now the confusion i am facing over here is
The application is an peer to peer application in which one user can do anything what other users can do.
There is no centralized server and there in no client. Every node acts as a server and client both.
So the application has to be peer to peer. But when i googled it then i am getting samples like client-server only and when i talk to my peers regarding this then also they suggest me the client-server model but there is no justification for why client-server and why not peer to peer. Am i right in this case ? Can anyone please guide me in this case because once i start development on any of these concept i cannot revert back due to time shortage. Your suggestions are most welcome.
I think the main reason a server-client relation is advised, is to make it easier for logging, or make a large chatroom for everyone (like IRC). If there is a login required, the server would also verify the login details. So without a server in between, phishing attacks would become more difficult to deal with.
I don't see why a P2P chat wouldn't work, though. If I recall correctly, Skype is doing that. I always love decentralizing. Good luck with your project. :)
You might want to check out the Zeroconf standard and packages that use it like Avahi (linux FOSS) or Bonjour (Apple & Windows open-source but not GPL). Zeroconf allows for configuration and detection of network services without user interaction or a central configuration server.
I end up using a client server model modified to support to P2P networking. When a node comes into the network it broadcasts its presence and the other nodes are continuously listening for new nodes. Each node will have their own list for the connected nodes in the network. In case of new node coming into the network they will update their own lists. I am using UDP for all most all the operations except file transfer as it needs to be in TCP.
I am looking for solutions for a problem that we are facing. We are planning to make a POC for Desktop Alert application. We will have a desktop AIR app that will connect to a Java Server. The server will need to notify Desktop App when it has a notification which will be displayed on the screen.
A couple of options that we have discovered are :
1. Keep a persistent connection between the AIR app and the Server, using some sockets and listen to any changes.
2. Poll the Server at intervals to check if some new data has come.
Since these options don't seem optimal (persistent connection) or seems performance wise (polling) better.
Is there a better solution for this problem or do we have to choose one of these?
For this, you could use a BlazeDS message service if you want to push messages to your client. Or a regular remote service with polling enabled.
It is built in out of the box and well tested equipment :)
Other technologies like GraniteDS or WebOrb for java are also possibilities.
Cheers