I have requirement
1) when application start the send to background by launching any other app like open url in safari.
2) when it will go into background then it will wait for incoming call.
I have done first one and after so much R&D i get that in background our app will alive for 10 minutes after that it will auto kill. So how do second ne point?
This is app not for jail-broken device. And according to apple rules what methods i can use?
Thanks in advance...
Take a look at Core Telephony Framework Reference.
And CTCall Class Reference / CTCallCenter Class Reference
Related
Now I am developing a voip app.
Is it okay to use background task to keep my app alive? so app can received incoming state to pop up a notification from the background.
I try CFStreamCreatePairWithSocket, but still can't get info from nsstream event callback.
If I use background task, App can get incoming state as it does in the front.
Thanks a lot.
Please always make sure to provide all required information to get quick help. e.g. Provide some code snippet if possible, provide information regarding which version of OS you are using etc.
Check following answer: It may help you. How to Maintain VOIP socket connection in background?
I need help, working on iPhone app using phoneGap 0.9.6.
while using app I want to block all incoming calls because i do not want the application to be interrupted.
Can any one help.?
No, you can't do this with any public APIs.
However, your application delegate will be notified when a call comes in, and you can prepare for this (save data, pause, etc.).
Is it possible? I don't think you can block calls in application.
Maybe you can detect Airplane mode & ask user to switch to Airplane mode if they haven't.
You can't. See also http://www.iphonedevsdk.com/forum/iphone-sdk-development/20349-how-do-i-detect-call.html
is it possible to wake an App in the background up, when a call comes in, and access CoreTelephony to send some infos over the web?
I'm practically a n00b in iOS development right now, but got asked a question if iOS is capable to do this. I searched in the iOS reference too, but with no luck.
It would be great if someone with more experience could answer it. Thanks a lot!
Steno
Please, have a look at the document about executing code in the background.
If you go to section "Implementing a VoIP Application", you will see that it is actually possible for your app to be awaken periodically so that it can check if it has anything to do (in your case, if I understand you correctly you would use CTCall to check for calling state).
So, basically, when awaken, your app could check for any incoming call and then use Core Telephony, as you say.
The only trouble about this is that if your app cannot be considered to a a VOIP app, Apple will not let it into the App Store.
It is not possible to have your code run when a call is received.
I wonder, if there's a way to get reason of applicationWillResignActive being called?
I'm developing an audio app, and I want to continue recording sound when the screen is auto locked, but I want to stop recording when incoming call occurs. How can I do that?
You can simply use the AVAudioSessionDelegate protocol methods like: beginInterruption and/or endInterruptionWithFlags: to check if the recording is interrupted and than you can do whatever you need.
In this case this approach has an advantage over registering to telephony events, because it works all the time recording, and not only for the first 10 minutes.
You can refer to the Core Telephony Framework in your application. This framework gives you the possibility of listening to the events and state of the phone on your device.
Moreover, the CTCallCenter class gives you the possibility of registering to telephony events to appropriately handle them through your application. This way you will be able to call a specific callback when an incoming call arrives, a call is started, terminated and so on. See the full list of cellular call states.
Hope this helps.
I've heard it mentioned elsewhere, one cannot programmatically hook into the phone call area of an iPhone using the current SDK. I'm looking to learn iPhone development and Obj C, with the end goal of creating a call timer app that runs in the background and alerts the user when a call has gone on too long.
Is it even possible to hook into methods liek that?
No. Your app will be interrupted when the user receives a call, and your code will not be allowed to run while the user is on the call. Additionally, there are no background apps allowed for the iphone. The best you can get is push notification, but you can't create a daemon or anything like that.
This information is provided in the iPhone Application Programming Guide
With version 4 you can now multitask to some degree.