Reputation: 4267
I want my app to be able to make a call to a contact at the date and time that will be arranged from the user. How could i make such a feature?Can i do this somehow through the calendar? Of course, i don't want complete code , just guidelines if that's possible...
Upvotes: 0
Views: 136
Reputation: 8357
Your application can not wake up at an arbitrary time. Your best option is to register a local notification, the user will get to say "okay" or "cancel" when it comes time to perform the task.
And if the user doesn't notice, then you can't make the call.
Executing Code in the Background
Upvotes: 2
Reputation: 15055
I believe that you can, pretty easily. Simply set a scheduled timer, or do something to get a function to trigger in the future. Then in the function use the following code to automatically make the call:
NSString *phoneNumber = [@"tel://" stringByAppendingString:mymobileNO.titleLabel.text];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
As to how that would work when the app is closed or in the background, I do not know.
Upvotes: 0