I need to integrate realtime aspect into my app. Basically, 2 users can edit UItableView and and it should be reflect on both apps. I am just wondering what’s the best approach for designing a real time app?
So far, I came up with 2 ways:
- Constantly query the server for changes, every 5-6 seconds, and update.
- Actually open up a socket, so make client behave like server and have the server send it updates.
Obviously, 1) is really bad because it will use a lot of bandwidth. 2) is kind of technical and will require a lot of low level socket programming etc to do.
What’s the best thing for me do here? Is this usually how realtime application are made?
Thanks!
The second option looks right for me, but of course you will have to use sockets and etc.
As a simple solution you can try
GameKit. I have made iPhone-to-iPad remote controller type of app and the best solution was to use GameKit. You might connect them via bluetooth or over the internet (in this case you will have to use GameCenter to connect them).Although I am not sure about apple’s policy for the applications which are not games but using GameCenter for connections.
So you might want to use GameKit just for testing at the higher level and then implement low level sockets if you need. But of course it is better to use sockets from start.