iPhone real time notification from a server, without using Apple push notification - iphone

I'm looking for a way to get real time notification from a server in an iPhone App. I don't want to use Apple Push Notification as I have many notifications. My web service is coded in PHP, and I haven't figured out an easy way to implement this functionnality. Any idea what should I do?
Thx a lot for your help!
EDIT : I'm looking for a way to get notification only when the app is launched (otherwise, the only option IS Apple Push not.).

If the app is running you can open an http connection from the app to the server and have the server hold it open, pushing data through it when you want. This is basically how COMET works.
This will only work while your app is running. If you need the notification to happen even if the user has closed the app then Apple Push Notifications are your only option.

You must use Apple Push Notification for achieving push notifications cycle on Apple's mobile devices.

Related

Is there possible make push notification without APNS

I need to know if its possible to make push notifications without use the APNS.
And if it can be done, what are the best options?
Web server ->pushNotification-> Device
What about the VoIP apps? --> Can we push notification without using APNs?
Thanks.
No, there is no way to use Push notification without APNS. This is restriction from Apple and is documented here
No you can not push notification to a device without using Apple's push notification service.
It is not possible to display push notifications for your application in the same way that the built in push notifications appear without using the Apple Push Notification Service.
You may be able to set up some kind of web socket-based solution, but that will not work when your app is in the background, thus defeating the point.
Check out Urban Airship
Push Composer makes sending Push Notifications simple for anyone in your organization. By putting the power of engagement into the hands of your business team, you can empower them to reach your customers quickly without adding strain on your engineering team. And because you can preview your message as you write it, you’ll know exactly how your users will see and engage with your message.

How to use Push Notifications

Regarding push notifications. How do I get the provision from APNS to implement push notifications in to my application. Help me guys.
start from these series
http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12
iOS developers love to imagine users of their awesome app using the app all day, every day. Unfortunately, the cold hard truth is that users will sometimes have to close the app and perform other activities. Laundry doesn’t fold itself, you know :]
Happily, push notifications allow developers to reach users and perform small tasks even when users aren’t actively using an app!
Push notifications have become more and more powerful since they were first introduced. In iOS 9, push notifications can:
Display a short text message
Play a notification sound
Set a badge number on the app’s icon
Provide actions the user can take without opening the app
Be silent, allowing the app to wake up in the background and perform a task
This push notifications tutorial will go over how push notifications work, and let you try out their features...
I followed the steps mentioned in raywenderlich tutorial. It's some what easy to send Push notifications to my iPhone app by using my system as the temporary server(ie, sending the message by running the PHP code from the Terminal window).
But, while going for production and dynamic messages for different users at different time, it's very tough for me to set the service in a server.
So, I go with third party server to send Push Notifications. - Parse.com
Tutorial for how to use that API.
Documentation about the installations of the application.
Here, we have a tag parse.com for questions about this process.

Retrieving latest Push Notification if app was not launched by hitting the 'View' button

I'm wondering if there is any way of retrieving the last-received push notification if the app is launched from the home screen instead of by pressing the 'View' button on the notification.
The app we're writing is for dealing with sensitive data, and it's important to be able for the central server to be able to remotely disable a client at will, without having the requirement that the app needs an internet connection to launch.
The basic idea I came up for this would be to send a push notification with a custom payload letting the app know to disable itself until it can properly sync its data.
This would work if the user pressed View on the notification, but not if they cancelled it and then launched the app separately.
I'd love to know if this is possible, or otherwise if there's a better way to implement this functionality.
It's not possible. Your app would have to connect to the server on launch and get its latest status from there. If your use case is that sensitive, push notifications are probably not reliable enough anyway because Apple does not guarantee that a push notification will actually be delivered.
Like Ole said, not possible.
Note that you shouldn't be relying on push notifications for anything like this. From Apple's push notifications programming guide:
Remember that delivery of notifications is “best effort” and is not guaranteed.

can we send messages to user even when the application is closed in iphone sdk?

i m making an application where data is accesed from website and displayed with an application.i have made an action which will tell the user that new data has arrived.this will work properly if the application is open .but if the application is closed than ,is there any way to tell the user that new data has arrived ,,so that he can open the application and check the data?
If you are using the Apple Push Notification Service (APNs), your messages will be delivered whether the application is running or not. For information on how to control what information is presented to the user, read the Apple Push Notification Programming Guide.
You should use Apple Push Notification Service, like codelark said.
I would recommend looking into Urban Airship for help getting started. It's a third party service, but it makes things much easier. Urban Airship does have their own tutorials and code samples which may be easier than Apple's.
As a follow up to the reference to apple push notification, as of ios4.0 I believe you, you may have a few more options, 1) you can send local notifications (just like push notifications, but they originate from inside your app) that could be timed to be delivered even if the app is not running..assuming you know approximately how long it will take for data to arrive. 2) if your data update will occur soon after the app closed.. your app can request a certain amount of time to complete an operation (even though the user has closed the app) and wait for the data, then send a local notification to tell the person to come back into the app. 3) if your functions based on gps updates, music streaming, or voip you can set a flag so your app continues to run in the background
sorry for the unstructuredness of the answer, this was just off the top of my head, hope it helps

how to use push notification in iphone SDK3.0?

i am new in the iphone application development. first tell me what is push notification? Why we use push notification? and last how we can use push notification?
Push Notification is where a remote server can send messages and sounds to iPhones and iPod touches who may or may not be running your application at the time the message is sent. That is, it's a way of getting around the fact that the iPhone does not allow third part applications to run in the back ground.
Apple have documented this pretty well. See the Push Notification Service Programming Guide for more details.