Background process to alert the user in iphone? - iphone

I am developing a iphone uiwebview based application to load an web application url by getting the user credential from a login screen,as i have username and password which are required to communicate with the server on the other end with web services,i want to make an
alert with some data to the user once after he logged into application.
But can i able to give that alert even he closes my application if then please suggest me how to do so?
I mean can i run any background service that can allow me to communicate some server with webservice calls and alert the user?
Thanks in advance......

If I understand your question right, you need to implement a push notification service for your app. Did you have a look at Apples documentation on local and push notifications? http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Introduction/Introduction.html
Or have a look at thee WWDC Video about it on iTunes.

Related

Showing Badges in iPhone Hybrid Application

We are developing a hybrid iPhone application. It has a webview that loads some mobile website. Website requires user authentication and once user is authenticated we need to show badge count for unread messages.
We are looking to use Push Notification to show badge count but I am not sure how should we register for push notification dynamically once user log-in and de-register once user log-out.
I believe if we can have some way to invoke native class method through javascript then we can achieve it.
Please suggest.
It is very simple whenever user logged-in, post a entry into the db and send notification for the records entered into the db and when user logging-out delete the entry from db

iPhone Push notifications via mobile safari

Is there a way to simulate push notifications by pushing data to mobile safari? Here are 2 scenarios.
I make a web app via phonegap and dont want to use APNS but rather make a web-socket connection and push data to the device myself. On the device end is there a "alert" function I can call to emulate a pop up when a user is not in the application?
Lets throw web app out the window. Is there a way I can do this in native mobile safari? Im not talking about a plain old JS alert window that would only come up if the user was in the app, but be able to do so with it backgrounded.
You cannot run background tasks with mobile safari so for #2 you can't do true push notifications or alerts. However you can send a user an SMS if you have the user's phone number. This can have a hyperlink to a part of your web site (which can contain some sort of payload). You can use a service such as Twilio to help you send SMS'es. However this costs money. APNS does not.
For scenario #1 I'm assuming you're talking about a native app using a phonegap solution. In this case when the app is backgrounded you cannot access any UI at all and wake up the app and show a UIAlert. In fact unless an app is registered for location updates or background music, the app is effectively not going to respond after a set period of time (it only can "finish" certain operations it had started before). So the websocket solution will only be effective if the user has the app opened.
You could register a local notification that runs at some predetermined time which will show an alert. But that is not being pushed from the server so its probably not what you want.
APNS is your best solution for scenario #1. Its not that hard to implement and its pretty inexpensive. Check out urban airship if you want to avoid building out your own server-side components for it.

How to notify iPhone client that server has new updates?

I am working on this iPhone app that connects to web services and receives data from a server. Whenever server has new updates, I would like iPhone client to show user that there's new stuff on server, and they can refresh the view.
I know this could be done with push notifications. But would also like this to work out on situation when user turned off push notifications on his iPhone.
Any hints would be greatly appreciated! Thanks! :)
You can only use Push notification for this if you want to inform the user of an update if the app ins't open.
You can of course display a UIAlertview if the app is opened, or just update the view with a nice animation.

Can an iphone application recieve push notifications from a custom server?

This is a very basic question on push notifications.
I need to know whether an iPhone application can receive push notifications.
I want them to operate as follows.
User installs the application.
When the application is not running, the user notices that something has changed with the application.
This is indicated by the application icon changing.
User opens the application and a new screen comes up that says:
"You have 3 new items to download"
The application will need to communicate with a custom server to obtain changes. The changes will only be known by that server, not the Apple App Store.
Is the above possible to program?
Yes. Your custom server sends them to Apple for distribution to devices. Read Apple's Push Notifications documentation for more info.

Application session in iOS?

I need to create a "login application" but I don't know about session in iOS. My application need login to my website (PHP based website) to get data. Can anybody tell me how to create and manage application session in iOS app? Thanks!
There's no concept of web/browser session (whatever that means to you) in iOS. iOS applications are just launched when a user touches the icon, and are quit when the user quit them.
Typically you require the user to input the login id and the password when the app is launched, and you create a web/server/browser session by accessing the web server. You can keep the id and the password securely inside in the storage of the iPhone, so that the user doesn't need to input them again and again whenever the program is launched.