can we return back to app without tapping it again? - iphone

HI
can we open our app without tapping it again on its home icon.
I am making a call in a addressbook app and when call is made than it call the phone app than is it possible after calling we can call our app again without tapping on it after the call is ended.
Sample code will be more helpful.
thanks

Short answer - no, once you leave your app, user has to return there.

I'm not 100% sure what you are asking, but if this is what you are shooting for:
a) Your app is running, and it causes a phone number to be dialed.
b) After the call is complete, your app is automatically re-launched.
Then no, this is not possible.

Related

How to detect whether user didEnterBackground because of phone call or click on home button?

We have a multiplayer game and sometimes user quit the game so we would like to know how did user quit the game. Can we use didEnterBackground for that?
We would like to know whether user quit the game by clicking exit button, or by incoming call, or by home button to exit.
When you press home button your application is sent to background and applicationDidEnterBackground will get call first and if it is by call, sms then applicationWillResignActive will get call first.
This is not perfect answer of your question but this might help you in some.
in the appDelegate.m File u have this function:
- (void)applicationDidEnterBackground:(UIApplication *)application
write the code you want in it. (saving data or anything)
First of all, the user interface guidelines forbid quitting an app programmatically and based on what I have read, apps the provide an exit button will be rejected.
If by 'quit the game' you mean something along the lines of 'terminated gameplay', then that should not be a problem.
Also note that pressing the home button does not exit the app. It simply sends it to the background. There does not appear to be any facility to detect why the app left the foreground, which probably means that Apple wants your app to handle all such cases in the same way: by saving state and being prepared to restart where execution left off. Note that an application in the background can be terminated at any time, hence the need to save state.
The answer to your question therefore would seem to be: don't do that.

Is there a method if application was closed in multitasking?

Is there a method like: wasTerminated or something like that? I want to display the user an alertsheet, if he has completely closed the app from multitasking. At the moment I have implemented my code in the DidEnterBackround, but is there another way to fix this? That would be very useful for me.
Sorry I'm a newbie and I didn't find a solution on the net.
Thanks.
Background applications can be terminated at any time, and there's no way for an app to tell whether it was terminated by the user (through the multitasking switcher) or by the system.
Your only notifications are –applicationDidEnterBackground:, –applicationWillEnterForeground:, and –application:didFinishLaunchingWithOptions:. With these notifications you can tell if some background task completed or not, but you can't tell how your app was terminated.
Do you want to show the message to the user, next time the user starts your app, or when the app is killed. If the app is killed by double clicking on the home button and killing it, and if you want to find out then, it is not possible.
But if the app is killed and the user starts the app again, then you will know whether the app is started fresh or did it become active.
The method
-(void)applicationWillEnterForeground:(UIApplication *)application{
NSLog(#"Entering foreground");
}
will get called if it becomes active from background.
Other wise,
- (void)applicationDidBecomeActive:(UIApplication *)application {
}
will get called where you can put your alert view.
You can easily experiment with these situations and figure out a way to do what you want.

How to make a Push Notification opens a specific uiview

I've been trying forever to get this to work, when I send a push notification to my app. When the user opens it, it just takes them to the app. I want to direct them to a specific uiview, how do I do that?
The method application:didReceiveRemoteNotification: is called if your app is running (whether in the background or not).
So that would be the starting point to direct them to the specific UIView.
You can tell whether your app was just brought to the foreground or not in the code in the following answer
Hope this helps .

Is there a way to change iphone app behavior when it is sent to the background?

Hey guys. I have a navigation-based app, and I want to control what the app does when it enters the background. In this app, the user has usually made it to the 3rd or 4th view controller before hitting the home button.
As of now, pushing the home button forces the user to restart the app from the beginning every time. This is a pain because it takes near a minute for the user to get back to where he was.
Is there a way to "close" the app while keeping track of the user's last page? I know that applicationDidEnterBackground: only allows a few seconds to close-out the session, and I dont know of any other way to accomplish this.
If anyone has any ideas, please let me know. Thanks!
If your app is running on a 4.0+ device then the default behaviour will be to return to where the app was before it entered the background. If it is on an older iOS then you will have save any session information yourself.

IPhone SDK Home Button

Is it possible to override the default behavior (close app) of the Home Button? And if how do you do that?
well, there's a reasonable alt to the need to detect if the Home button was tapped. i'm currently working on just such a scenario.
my app allows user input (into UITextViews). a customer has asked for an "autosave" feature where, should they (accidentally) tap the Home button during data entry, could i still capture the data entered and save it.
my testing of the sequence of viewWillDisappear in the view that is collecting the data and applicationWillTerminate show viewWillDisappear getting called before applicationWillTerminate. now i fully appreciate that this is the architected sequence Apple intended, BUT this sequence also precludes setting a simple Boolean in applicationWillTerminate to let the particular viewWillDisappear know that it is disappearing specifically due to applicationWillTerminate.
so the issue still stands. how can a UIView detect that it is disappearing specifically as a result of the app terminating?
Even if it is possible, your app will probably not be approved by Apple.
Are you planning this feature for your own private App or do you want to distribute it later on?
The home button is probably the most critical button on the device on not a good idea to change