tags:

views:

719

answers:

5

My app should post some message to Twitter at the end of each day at the time X. App might not be running at this time X, but it still has to post that message. I don't want to bother user by everyday asking to do this task.

Can I use Push Notification to silently (without any alert view popup, sound or anything else) do some task in my app in some constant time everyday even if it's not running?

thx

A: 

To do so silently is not up to you. The iPhone device has a configuration in which each app with a Push mechanism has settings where one can specify if they want alerts or not. If set to yes, the text of the alert is displayed as well.

Raj More
i dont think this addresses the underlying question in regards to the app initiating a task when the app has not been opened by the end user.
thomas
A: 

sounds like you are trying to "wake up" your app at a specific time each day to perform some type of task. from what i understand about the iPhone this is not possible. you cannot create a cron job or something that will fire on a time you specify. you can run this on the server side and then push a notification to the user telling them that the message has been posted to twitter.

if you are on a jailbroken phone i feel confident that there is some way to do this.

thomas
A jailbroken phone has access to `cron`, so yes.
ceejayoz
A: 

Given that push notification requires that your server send a notification, why not skip a step and have the server just send the update directly to Twitter on the user's behalf? You can't use push notification to trigger an automatic task on the iPhone like you're asking - the user must take the step of accepting the notification for anything to happen.

ceejayoz
+3  A: 

There are three 'notification' mechanisms you can send via push: alerts, sounds, and badge values. The way the push notification works is that on the phone it launches the app and hands over the 'push payload' to it with those values. Even if you turn off all three mechanisms, the OS will still have to launch your app each time, which means the user will get interrupted.

In short, you can't have a push happen silently. I doubt, from a user-experience point of view that Apple will allow things to happen on the phone without the user getting notified somehow.

Ramin
+1  A: 

No.

You can't schedule things to be run by your app on a non-jailbroken iPhone.

The only solution is to have a separately hosted service somewhere to which you push details from your app and that runs the scheduled updates on your behalf.

Andy Dent