0

I m writing ios app on 4.3 simulator and 3.2 xcode

The app every minute with timer NSTimer checks news on some websites and if there are news, the app will make alert message with sound "There are something new on ... website!"

But if i close app or it goes to sleep, timer stops on background. So, i have read many articles like http://www.codeproject.com/Articles/124159/Hour-21-Building-Background-Aware-Applications

How keep NSTimer when application entering background?

and non of them helped me. my questions:

1) What technologies or tricks should i use to make such app? One good man told me that i need to use only Push Notifications.

2) If to use Push Notifications, do i have to get Developer Program $100/year from apple and stay my Mac book always turned on for creating server for Push Notifications?

thank you!

Community
  • 1
  • 1
sirjay
  • 1,767
  • 3
  • 32
  • 52
  • You have to pay the 100 per year simply to publish the app for the iDevices anyway much less for push notifications. – trumpetlicks Mar 01 '13 at 23:36
  • You should also consider upgrading to Xcode 4.6. Xcode 3.2 is pretty old. You can still support iOS 4.3 if you need to. But most people are running iOS 6.x at this point. Supporting iOS 4.3 is kind of pointless unless you have a specific reason to. – rmaddy Mar 02 '13 at 00:17

1 Answers1

1

There are only a few approved uses for running in the background: music, navigation, VOIP. If your app doesn't do one of those things, it can only run in the background for up to 10 minutes, then it will be suspended by the OS.

Push notifications require a server. You either run it yourself, or you use a service like urbanairship.com. A push notification just shows up like an alert on the device. It doesn't make your app wake up, unless the user does it by responding to the alert.

Please read this: http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

If you haven't paid the $100, you can't run your app on a real device. I don't think the simulator properly simulates background states, so debugging background tasks is going to be pretty difficult.

jsd
  • 7,673
  • 5
  • 27
  • 47
  • Thank you for answering. So, will learning Push Notifications lead me to my aims? – sirjay Mar 01 '13 at 23:58
  • If your aim is to send an alert to a phone when a website has a new article, then yes, you can do it with push notifications, but you will need a server that is constantly scanning that website for updates to send out the push notifications. – jsd Mar 02 '13 at 00:39