I need to execute a function when app is in the background or even when is killed by the user, automatically based on time Intervals
Requirement: After user registered (Ex registered date Jan-1, 2015) , I need to change the status of a functionality as enable/disable based on following time intervals and notify user when app is in active mode or in background or it is killed.
Registered date Jan-1, 2015: View photos functionality status is changed as follows. When status has enabled Mode user can able to see photos by taping on photos row in a table. When status is in Disable Mode user can not able to see photos and generate an alert by taping on photos row in a table.
First 2Weeks: Disable 2Weeks - 5th Week : Enable 5th Week - 12th Week : Disable 12th Week - 3months : Enable 3months-8months : Disable 8months-12months : Enable 1Year - 1.5Year: Disable 1.5Year- 2Years Enable After 2 Years - Status switches between every 3 months.
I am done with the Dates calculations.
But i just want to know how to execute a function when app is in the background or even when is killed by the user, automatically based on time Intervals
THanks in advance