recognize that user call somebody - iphone

how to regognize that user call somebody from code?(means i have an app and want to do sth when user call somebody)

You can't do that I'm afraid, firstly your app won't be running when they are calling someone and secondly you can't access the phone functions from the SDK. Might be possible with a background process on a jail broken phone.

This is not possible, not through code nor through notifications. You can't do anything to stop this, when a phonecall comes in, your application gets suspended, like as if you'd press home in iOS 4 and it will multitask if it has been programed to do so. Have a look at the UIApplication implementations for multitasking and do your work there.

Related

Bring my app to the foreground in Objective-C

My app has to run for a long time (also) in the background, due to Location Services.
When a certain condition is met the app has to move to the foreground.
I was able to run my app in the background and bring it to the front manually.
Reading up on this issue I got confused on how to move my app to the foreground by code.
It has to be in an if statement but what to do from here?
No do not think this is possible. You will be able to spawn a UILocalNotification to show application state to the user, but it is my understanding that iOS prevents you from making your app take focus.
you can't do that without user interaction. You can present a UILocalNotification
-- you can't even be sure iOS leaves it running though!
on a jailbroken phone I guess it is possible
This is clearly not possible, as it would be a mess if any app could just take over control at any point in time. As mentioned, you have to post a notification, and then it is up to the user if he or she wants to launch the app. If you notification states a good reason why they should launch your app, they might very well do it :-) And remember, don't mix up the user's needs with your/your app's needs.

App that reacts on the voice of calling party

I need to develop an App that reacts on the voice of the caller - so the participant in the phone call who is 'not there'.. specifically:
Someone calls me and stops speaking. The app should alarm me saying "participant stopped speaking" (it does not matter if the sense of the app seems stupid for you now ;-))
My question is just - is this technically possible? Since apps normally are paused as soon as a phona call comes in. I know they can be restarted during the phone call - but can they react on the voice on the other side of the line or is this only possible for my own voice?
If you think its possible, any special things i have to know?
Thanks a lot!
tim
This is not possible. Because when any call comes in iPhone our application loose control and it goes in background.
With official SDK it is not possible to intercept any phone calls.
Hope this helps.
This is not valid IDEA using standard SDK, though you can do this using some other IDEA's one of them is CYDIA.
Thanks,

Start my iPhone app on the end of call

I want to develop an app which records the call-duration etc.. when a call is finished. So is it possible to start my app when the user finishes his call.
App is currently not running and then
User Finishes his Call ---> My app should open up the moment he finishes his call giving me the details about call duration etc.. and then i ask for some comments on that page and exit the app.
I already made such an app in Android,Blackberry.
P.S: Even if it works on a jailbroken iPhone it is good enough for me.
There's no way to do this on a regular iPhone. Apple's APIs don't allow you to interfere with phone calls at all.
Not sure about jailbroken phones though. In theory, you can do anything, it just depends on how much time you're willing to spend on it. Good luck.

how to keep getting "accelerometer:didAccelerate:" when app in background

How can my app keep getting a call to its "accelerometer:didAccelerate:" method of UIAccelerometerDelegate IF another app interrupts my app, such as the iPhone user receiving a phone call?
My app measures motion, but stops if suspended by the user, or if interrupted by another app.
I know this has been difficult in the past, but maybe there is something new in iOS.
Thanks!
You can't, apple standards are to block the app when a proccess pops in, It freezes the app at the moment it was interrupted. If finishes the last proccess it started in the background then it freezes the app. If you find a way around it i'd love to know it. Here is something that might help you to find the solution stackoverflow post similar to your question

How can I close an iPad app in Objective-C?

I would like to close an iPad application as a result of clicking on a UIButton. However, I have not seen how to do this in the Apple documentation.
What call needs to be made to close an app?
Thanks.
You can call exit(0) to terminate the app. But Apple don't like this as this gives the user a feeling of sudden crash. If you still want to have an exit function (with a potential risk of rejection) then you should also send your app delegate the applicationWillTerminate message (if you have anything important there) before performing the exit.
It says:
Don’t Quit Programmatically
Never quit an iOS app programmatically because people tend to
interpret this as a crash. However, if external circumstances prevent
your app from functioning as intended, you need to tell your users
about the situation and explain what they can do about it. Depending
on how severe the app malfunction is, you have two choices.
Display an attractive screen that describes the problem and suggests a
correction. A screen provides feedback that reassures users that
there’s nothing wrong with your app. It puts users in control, letting
them decide whether they want to take corrective action and continue
using your app or press the Home button and open a different app
If only some of your app's features are unavailable, display either a
screen or an alert when people use the feature. Display the alert only
when people try to access the feature that isn’t functioning.
The only way for a user to exit an application is by pressing the Home button. You can't do it in your app, at least not in a way that Apple would accept.
You can try to use command:
exit(0);