Call to a phone number through iPhone App

不想你离开。 提交于 2019-12-23 03:26:52

问题


I want to add features in my iPhone app:

  1. call to a phone number in my app
  2. play a recorded mp3 voice to that number
  3. after call ends, relaunch the previous app

I know I have to use following code snippet for dialing to a number XXXXXX:

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

My be play record not worked, as my app will terminate when call dial launch. Is there any way to do this?

And, after the call ends or fails, will my previous app relaunch?


回答1:


Not possible (without jailbreak).

Once the iPhone is in a call your app will quit and you will not be able to play any sound. You can also not relaunch the app after the call - the user has to do that themselves.




回答2:


After the call ended/failed, your app will be relaunch.

My guess is that what you try to do is not yet possible. It might become possible with OS 4.0 but you should ask the question on the developer forum.




回答3:


Try this telprompt instead of tel like below modified code :

 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"telprompt:XXXXXX"]];

Then it ll come back to app after call ends.this may help you..



来源:https://stackoverflow.com/questions/2818968/call-to-a-phone-number-through-iphone-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!