Messaging service within my app - iphone

I need to implement a message service into my app that works exactly like this:
users register with a nickname within the app
they can add contacts (just nicknames) and send them a message by just specifying their nickname
they can send a message whenever they want, and the message is stored on a server until when the receiver connects to internet.
when a message is received, a push notification is triggered.
So, the messages work pretty much like emails, however instead of using email addresses, we only use usernames. I'm also going to build my own back-end for it.
Which APIs should I use or which 3rd party framework can I use ?
And any tip ?
N.B. I need to make it work with iOS 3.0 as well.
and in the future I will develop an Android app, so the nicknames should be unique and I should be able to send messages from iPhone to Android devices within the same app.
thanks

I've successfully used the Three20 library and would recommend giving it a try. It's an open source spin-off originated by the author of the Facebook app. It features a bunch of additional GUI components that might be useful to your project, like a message composer that resembles the one used by Apple's email app.
Also, Three20 features a nice framework for handling navigation within your app. Currently, the biggest drawback seems to be that certain features don't play well with the iPad API.

The answer seems to be Push Notifications

Related

iPhone push notification urbanairship, phonegap, c#

I want to create an application which will be notified by server for new events. (lets say I have a shop and I need to inform all my iPhone users for my sales or something like this) Users who will download my application and run it and then put it in background wil have to be notified by this. Im quite new to iOS and Objective-C but if im not wrong this could be done via apple push notifications. Ive been reading about this and found out there are some providers that let you send this notifications. My question is, are there ways to create your own notification "center" in lets say c# and send notifications to iPhone-s by yourself, also if this could not be done are there any free providers?
and another thing. In objective-c app you have to subscribe your app to listen to that kind of events. Could you create app in phonegap or some other technologies so it will work with notifications? could you lets say embeed your app in objective-c (like web app in objective-c)
For sure you can do your own C# program that will push APNs to your clients (in fact I did that myself in many apps). What you have to understand is that the architecture of APN has 2 critical facts:
APNs are best effort, so no guarantee that they will reach every time.
APNs can not hold a lot of information with them when they reach your client (they have a limited number of bits, refer to the Apple documentation).
Due to these facts you might need to have your own server application (also could be in C#) that will handle sending the real information to the clients and will make sure that the data reached your client as well. Needless to say, this server application should sit and run on a real server. Maybe due to this fact some developers start looking for a third party solution, but personally I prefer not to use a third party and I do everything myself.
Other than having your own server application, your iPhone app will need to have some sort of database (probably SQLite3) to store the received news and display them later on.
EDIT: Answer of your questions in the comments below:
For the first question "why iPhone app must have sql db". In fact it is not a must, as I said in my answer above, it is probable or a possibility. To know if you will need a database or not this depends on the nature of your app itself. For example you might be pushing text and images to your clients and in that case you can not fit such data in the payload of the APN. Another possibility, you might want not to lose the sent notification even if the user discarded the APN message, you might want to show it again when he opens the app later on... So the nature of the app decides whether you will need a server or not.
For the second question "you said you dont need to send notification via third party", let me clarify something in my answer. As an Apple developer I don't consider Apple servers as third party. Put differently, the real APN will only be sent via Apple servers and we can not change this fact (nor do we want to change it too). So at the end of the day the real APN will be sent to Apple servers and Apple servers will work on delivering it to the actual client. What I consider a third party is someone that has his own server, you send the message you want to him, and then he sends it to Apple servers. In that case there is someone between you and the Appl APN servers and this is what I called a third party, and this third party can be avoided as your C# code can directly connect to the Apple APN servers and ask it to send the message to the client. I hope I clarified my point.
Yes, you can use APNS with the phonegap application: Receiving push notification on PhoneGap for iOS
Regarding the server, there is another option for you besides doing everything from scratch. You can use the third-party server via API, seems that pushwoosh (http://pushwoosh.com) guys offer this option (and they provide phonegap integration as well)

Expecting your views on developing an app like "Agile Reply"

I have read many post indicating that we can't send sms on Missed Call, but i would like to know the reason behind that.
Also there was a app called "Agile reply" for iphone but i cant find that app in the app store actually.it seems that it has been removed from the app store
I would like to develop an app like sending sms on missed call / un answered call.that app needs to be posted on "App store".my app needs to run on iOS 4.0 and 5.0
Please share your view on developing app with this kind of functionality and its possibility
why this kind of app will be rejected.
The Agile Reply app didn't send texts automatically upon a missed or unanswered call -- it just allowed you to quickly compose a message to the last number that called.
If Apple have decided they're unhappy with this sort of app, that's the end of the story. They have their reason(s), and whatever you think of those reasons, they're the gatekeeper of the app store; their say is final. Of course it might be possible to develop something like this for jailbroken devices, but that's a different story.
As for the reason that Apple didn't like the Agile Reply app: the following two reasons seem plausible to me (but are also just educated guesses on my behalf):
1) The app accessed private APIs
2) Apple thought that the app didn't offer anything new or worthy: they might have reasoned that it is easy enough to go into the built-in phone app, select the last (missed) call, and compose a message to that number, without the need for a custom app

How to integrate Juggernaut chat server (Powered by ruby on rails) with iPhone/Android app for real time chat?

Preview:
I am using juggernaut chat server.I am having redis and juggernaut server running on machine. I am able to do chats within my local network on vaious web browsers. Everything is working smoothly. As juggernaut is a server driven chat server so i am quite sure about the scalability thing. Now here is the thing:--
Whats the problem:
I want to have a iphone native app too where user can login and chat with his friends. Now the thing i want to know is how do I push on iphone app, cause for juggernaut client registration a javascript code is needed. Something like this:
var jug = new Juggernaut;
jug.subscribe("channel1", function(data){
alert(data);
});
Basically how do i push new notifications to Iphone chat window. I don't know much about iphone as I am web developer. Still from google search etc I came to know some possible ( may be) ways:-
We can embed a url in iphone window. Is this a good approach?
Other thing we can do is using UrbanAirship kind of services we can do push notifications. Will push notification works for chat? I don't know about that even.
Third option can be polling. Iphone chat client keeps on hitting my rails app for new notifications. But i think this will be a very bad approach.
What are the other possible solutions?
Can any iPhone/Android developer guide me what should i do. I will eventually hire a Iphone developer to do all the coding part. But I want to have a big picture in my mind so that I can provide a complete docs of all the things, and have a clear picture how I want to discuss things with him before writing down the code.
PS: I am looking for a solution which works for android/nokia devices too. Cause later on I will be developing an application for that too. Basically it will be good to have a same solution. if not then compatibility factor should be there atleast.
Apparently there is WebSocket support in MobileSafari on 4.2 (source). You could probably write up a client that uses an embedded UIWebView to marshall the events to/from the Juggernaut server and deliver them to your app via shouldOpenURL and custom handlers.
You might also look at libPusher by Luke Redpath for interacting with push communication via the Pusher web service.
Check out this library: https://github.com/fpotter/juggernaut-cocoa
It's really easy to use.

Direct communication between iPhone users

I'm new to iPhone programming. So far I've only written a couple of simple apps just to get the hang of it. In a short time I will have an assignment to write an app that will let iPhone users communicate directly using short messages, and probably they will add a requirement to be able to send files to each other attached to the messages. Of course this sounds a lot like a mail client. For several reasons the client does not want to use mail, if possible, and attaching files would leave SMS messaging out. I've been reading Apple's documentation on local, push and broadcast notifications. Would any of these be the way to go?
Thanks
User bonjour if you are one the same network: http://www.mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/. Otherwise it sounds like you want to use Push. I'd recommend checking out Urban Airship

iPhone: Need suggestion for SYNC contact

i want to create a application which sync my iPhone contacts to my server and vice-versa.
i read a article on google Get Google Sync on your phone . i want to this type of feature which directly update the contact without user interaction (however one time setting is desired).
any body have idea how the google sync work .
Please advice me that how can i achieve this task. any suggestion and link is greatly appreciated
I think it's important to separate the two overlapping approaches in your question.
Firstly, Google Sync is essentially a way to use Microsoft Exchange protocols and to setup a Mail / Contact / Calendar profile on an iPhone. The iPhone OS supports this feature, not an iPhone App in the App Store. Google Sync leverages this fundamental capability of the phone by exposing the data (mail, contacts, calendars) via these known protocols. If you want to expose data in this way to your users, setup a Microsoft Exchange server and ask questions on serverfault.
Secondly, there are iPhone apps. iPhone apps sold in the app store are not currently allowed to run in the background. This means you can't emulate functionality like iTunes or Mail where your music plays while you are browsing the web, or mail checking is done while you are playing a game of Mini Squadron. If you want this backgrounding capability, file a bug/enhancement with Apple.. However, you can interact with iPhone contacts (Address Book) via the API.. You can also of course "re-invent the wheel" and expose the data however you like via the internet, and consume that data from a custom iPhone App with the one caveat that users would need to actively launch your application to get to this data and it would not be integrated with the built-in iPhone Calendar, Address Book or Mail applications. Some good examples of that are some of the music community apps that have messaging systems built into them. Presumably that is all being done with web services.
EDIT: It is also worth mentioning that should you go the "iPhone App" route, you should at least consider if push notifications are right for you, and if so how you will handle it.
Have you seen the API-Docs?
http://developer.apple.com/iphone/library/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/100-Introduction/Introduction.html
Next there is an application I use called Funambol - it is a sync4j Server/Client. They have an open source application to sync contacts on the iPhone. Source is somewhere in their repository, informations here: http://forge.ow2.org/scm/?group_id=96
As slf told you your application must run in foreground. This may limit you.
Good luck & best regards,
Florian
The 3.0 SDK will allow your application to read contact data on the phone.
Web services will allow you to publish that data to your server, and receive updates.
You may also want to use coredata to store a hash of all contact data so you can tell what is new / updated and just send that data to your server.