vongolashu
vongolashu

Reputation: 375

Run a function everyday in background in iOS

I am stuck at this and would appreciate if someone can help me in this
I am a beginner and creating a iOS app (want to support ios 5-7)
My App will check for upcoming movies and show a notification if a movie has released that day, all movie data and date checks will be done by a function and movie release dates are stored in a local file
What I want to do is run my function every day (each 24 hours) in/from background even if app is not running, since I donot want the user to launch app every day to check for movie updates or releases, I want to check for this in BG

So, I have a function which will check and show a notification if today a movie released and want this function to be executed every day automatically even if my app isnt running/launched by the User

Upvotes: 0

Views: 512

Answers (2)

Ashok
Ashok

Reputation: 6244

For the complete solution, at server end, you need to maintain data per user/device over how much information has been sent to the user/device when the last time device was connected to internet.

And, based on the data available to the user/device, you can use combination of UILocalNotification and APNS (server driven). If the release dates are known (stored locally) then use UILocalNotification and otherwise use APNS (when info is not available locally or there is change of dates suddenly).

Upvotes: 0

chancyWu
chancyWu

Reputation: 14383

I think Push Notification is the right solution. You can refer to this tutorial .

Upvotes: 1

Related Questions