I was reading up on the
forums, and I noticed that GetResumed() does not work for iOS devices. I'm assuming that this is still the case, as I tested it out on my iPhone and it didn't work.
I just did some searching on the Apple dev websites, and was wondering if the AppGameKit team could (in the time being) use GetResumed() as a handle for applicationWillResignActive()?
From the Apple docs:
applicationWillResignActive:
Tells the delegate that the application is about to become inactive.
- (void)applicationWillResignActive:(UIApplication *)application
Parameters
application
The singleton application instance.
Discussion
This method is called to let your application know that it is about to move from the active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. An application in the inactive state continues to run but does not dispatch incoming events to responders.
You should use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. An application in the inactive state should do minimal work while it waits to transition to either the active or background state.
After calling this method, the application also posts a UIApplicationWillResignActiveNotification notification to give interested objects a chance to respond to the transition.
Availability
Available in iOS 2.0 and later.
Declared In
UIApplication.h
I'm not sure how AppGameKit works under the hood, but when this method is called - and the application is losing focus - couldn't you internally set the value of GetResumed() to 1 at this point? This is available in iOS 2.0+, so it wouldn't break anything.
I'm just stating this, from my own perspective. I mean, GetResumed() is just a way to tell if the app switched between background and foreground states. If you are having issues figuring out when the application regains focus on iOS, why not just catch it when it's heading out into the background?
My two cents
P.S. I'm tired and I'm just throwing this out there. You guys are more amazing devs than I'll ever be, but just thought of this, just now!
Hi there. My name is Dug. I have just met you, and I love you.