How Apple Push Notifications Deliver to the User in iPhone app? - iphone

Am developing an iPhone app. In my current iPhone app i want to integrate APNS that we want to send a messages to the user. I gathered information about APNS. But, still i have some doubts on the APNS.
How APN works that means how the push notifications showing to the user?
If our iPhone app get closed from Background, the Apple push notification will work or our app should be in run?
What will happen if we send a notification to the user but,if the user is in offline. The message will deliver to the user once the user gets online (Get network connection) or the message won't show to the user?
Push Notifications will be show the user if the user doesn't open the app in their iPhone?
Can anyone please guide me on these doubts? I hope on you friends. Please help me. Thanks in advance.

I think you did not follow Apple developer library instructions. I have doubts about your understanding of APNS and its working.
When you send the notification to user, and his cell is off or not connected to the internet, he/she will get message/notification when his/her cell will turn on or connect to the network.
And Push Notifications also work when your application is in backGround or user is not using the application.
Hope this information can clear your confusion, you should look in to the apple developer videos and SDK about push notifications.
Also this is SOreadytohelp.

You asked quite a few questions. I'll try to answer some of them as well as I know:
How APN works: You send a message to Apple's servers with the specific device ID. Apple will deliver that message to the iOS device. (You likely want a more specific answer, so please ask.)
If your app has been allowed background app notifications, then they will be delivered in the background. (The user can enable/disable this)
If the particular iOS device is not connected to the network, notifications will be queued. But, identical notifications will get discarded and only the most recent will get delivered. See: Quality of Service
Yes (basically the same answer for 2).

Related

Access device messages in application

How can we read our device inbox message in our app? I have to read all messages which i have in my device message inbox.
Thanks
Are you asking how to access emails or SMS messages? If so, there's no way to do that. You don't have access to that kind of personal user data using the iOS SDK. Just think about the controversy that UDID's are causing right now, and consider what would happen if a third party app had that kind of access.
You can access messages only on jailbroken device.
Your app will most definetly not be approved for App Store.
If you're still interested, see the accepted answer on How to Make Application which Store Sent and Received Messages in iPhone

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.

iPhone App Link To App Update in AppStore

Does anyone know if you can send a user to an app's update in the appstore?
We want to do this from within the app and/or when getting a Push Notification.
Thanks!
Yes, it is possible as long as you have the URL that links to your app.
I'm not 100% sure, but I seem to remember seeing something in the apple rules that means you may not be able to send a push notification advertising new apps. But an update may be ok.
Remember as well that a user may have already updated the app because they had the badge on the AppStore icon and then you push a notification out to all users. Could be annoying.

iPhone: Is it possible to send Push-Notifications from a website?

I'd like to be notified of certain events on my webserver with a push notification from my website to my iPhone. Is this somehow possible, or do I have to install/create a special App for this?
In order to use Push Notification it would have to be a native iPhone app on your phone. You might be able to set up some sort of email notification coming from your website and turn on push notifications for your mail client on your iPhone.
In regards to #gnuf's post (Sorry it wouldn't let me comment on your post) Your web server can act as the Provider of Push Notifications but will still require a native application on the phone to receive the notifications.
You can definitely send notifications triggered from a website: you just have to hook up the backend to do so. See this previous post for more information.

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.