开发者

iPhone background app showing Call alert

I am new to iPhone programming and I have a question. If I have an application that needs to initiate a phone call at 11:00 AM, is it possible for the app to show a call alert to the user? so the user at 11 would see the number pop up with a call or cancel option. Thoughts? Also is this also possible if my app is not running in the background an开发者_运维技巧d If I have to initiate using push notification.


You can do this by using a local notification that will bring your application to foreground (well, sort of, an alert will be displayed that will allow the user to take the appropriate action).

In order to launch a phone call you are going to use the openURL method on the application object like this:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:12345689"]];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜