uiapplicationdelegate

ApplicationWillTerminate in iOS 4.0

青春壹個敷衍的年華 提交于 2019-11-27 03:20:59
The applicationWillTerminate delegate method is not getting called in iOS 4.0 When I hit the Home button I am seeing the applicationWillResignActive and applicationDidEnterBackground delegate methods getting called. - (void)applicationWillResignActive:(UIApplication *)application { NSLog(@"Application Did Resign Active"); } - (void)applicationDidEnterBackground:(UIApplication *)application { NSLog(@"Application Did Enter Background"); } And when I double Tap the Home button and again launch the Application the i find the applicationWillEnterForeground and applicationDidBecomeActive delegate

Background request not execute Alamofire Swift

血红的双手。 提交于 2019-11-27 02:52:54
问题 I'm trying to make calls in background like POST,GET to be more precise in the didReceiveRemoteNotification method, because they start to work as a push notification arrive. My problem is that all the Alamofire.request are never call in Background mode until I open the app. I have by now Im was trying to open a session but it won't make the request work. These is what i want to execute in background (cellphone in background) Alamofire.Manager(configuration: configuration).request(.GET, url,

iOS Application Background Downloading

放肆的年华 提交于 2019-11-27 00:48:50
问题 Hey! I need to know how I can have my iOS Application start a download in the background of the application (like, have the download run in the AppDelegate file) so changing ViewControllers will not interrupt or cancel the download. I also need to be able to get the progress of the download ( 0.00000 - 1.00000 ), to set a UIProgressView object to, which also means I need a - (void)progressDidChangeTo:(int)progress function. 回答1: Just use ASIHTTPRequest it is way easier than NSURLRequest and

iPhone GPS in background never resumes after pause

可紊 提交于 2019-11-26 22:11:01
My application needs to track user location changes in the background and works fine as long as user moves around. When user stops and CLLocationManager pauses after 10-20 minutes or so. It is indicated by this notification: -(void)locationManagerDidPauseLocationUpdates:(CLLocationManager *)manager{} And this is also fine with me. Great, I save some battery, etc. The problem is that CLLocationManager never wakes up when user starts moving again and following delegate methods are never fired until I put my application to the foreground (gets active): //Never called back after CLLocationManager

Display a view or splash screen before applicationDidEnterBackground (to avoid active view screenshot)

两盒软妹~` 提交于 2019-11-26 22:08:12
I have confidential informations in my app, so I would like to hide them with a splash screen when the app is about to be moved to background. I do run the app on iOS6 and further. I tried to display the view in applicationWillResignActive but the problem is it display the splash screen even when user swipe control panel for example. I want it to show only when the app is moved to background. I tried to displayed my splashScreen in applicationDidEnterBackground but it takes the screenShot before so informations are displayed at restoration during the animation. Here the spirit of what I want :

Is there any way to check if iOS app is in background?

眉间皱痕 提交于 2019-11-26 18:59:54
问题 I want to check if the app is running in the background. In: locationManagerDidUpdateLocation { if(app is runing in background){ do this } } 回答1: App delegate gets callbacks indicating state transitions. You can track it based on that. Also the applicationState property in UIApplication returns the current state. [[UIApplication sharedApplication] applicationState] 回答2: UIApplicationState state = [[UIApplication sharedApplication] applicationState]; if (state == UIApplicationStateBackground |

Behaviour for significant change location API when terminated/suspended?

冷暖自知 提交于 2019-11-26 18:03:46
This is the section from the CLLocationManager documentation describing the app behavior with startMonitoringSignificantLocationChanges : If you start this service and your application is subsequently terminated, the system automatically relaunches the application into the background if a new event arrives. In such a case, the options dictionary passed to the application:didFinishLaunchingWithOptions: method of your application delegate contains the key UIApplicationLaunchOptionsLocationKey to indicate that your application was launched because of a location event. Upon relaunch, you must

didReceiveRemoteNotification: fetchCompletionHandler: open from icon vs push notification

荒凉一梦 提交于 2019-11-26 17:35:22
问题 I'm trying to implement background push notification handling, but I'm having issues with determining whether the user opened the app from the push notification that was sent as opposed to opening it from the icon. - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler { //************************************************************ // I only want this called if the user

applicationWillTerminate: not being called

核能气质少年 提交于 2019-11-26 17:17:15
问题 I'm using applicationWillTerminate: to save some last-minute stuff. But the problem is that it never gets called. If I do something like this at the top of the method: NSLog(@"Something"); it doesn't get called and doesn't get outputted to the console. Does anyone know why this is happening? 回答1: From Apple docs: For applications that do not support background execution or are linked against iOS 3.x or earlier, this method is always called when the user quits the application. For applications

UIApplication sharedApplication - keyWindow is nil?

此生再无相见时 提交于 2019-11-26 16:58:12
问题 I want to convert a CGPoint from my UIView to UIWindow coordinates and have realized that UIApplication keyWindow is always nil; why is this? I have tried the convertPoint:toView: method from UIView. Please see this sample code I tried in the view controller in a template of Xcode (View application): - (void)viewDidLoad { [super viewDidLoad]; UIView *test = [[UIView alloc] initWithFrame:CGRectMake(40,40,250,250)]; [test setBackgroundColor:[UIColor redColor]]; [self.view addSubview:test];