Skip to main content
Participant
May 8, 2012
Question

iOS Home Button and Event.ACTIVATE/Event.DEACTIVATE

  • May 8, 2012
  • 2 replies
  • 2516 views

Hi all,

I read tons of questions re iOS Home Button and Event.ACTIVATE/Event.DEACTIVATE. Everything should work well if you set the proper listeners and save/restore your app state upon receiveing these events.

My question is: Is there a way to tell difference between a Home Button press and an iOS notification alert or incomming call? In both cases, AIR will dispatch Event.DEACTIVATE, however I want to know if the user pressed the Home Button or if he just received an SMS/Calendar alert, and adapt my app state accordingly - i.e. if it's a Home Button press, change my app state to "Main Menu", otherwise (SMS/Calendar/alert) I will pause execution.

NOTE: I don't want to override the Home Button behaviour, just want to tell if it's a Home Button press or SMS/Calendar/alert, and react accordingly. The iOS documentation states that in case of SMS/Calendar/alerts, (void)applicationWillResignActive:(UIApplication *)application is dispatched, and in case of actually going to background state (i.e. Home Button pressed) (void)applicationDidEnterBackground:(UIApplication *)application is dispatched.

Thanks

This topic has been closed for replies.

2 replies

daotting
Participating Frequently
June 28, 2012

Any luck with this yet? I'm having the exact same issues but on a different device, the Kindle Fire.

I need to determine whether a user hit the Home button, or hit the Quick Settings button (that accesses controls like volume). Air treats both events equally by broadcasting Event.DEACTIVATE. Unfortunately, the Amazon Appstore approval team thinks otherwise...

It seems like there should be a simple, no-brainer way to track these events, but I'm beginning to suspect Air just is not capable. In that case, if you're developing for Kindle Fire, you may want to avoid going with Adobe.

February 21, 2013

@rafa.nanya: @daotting: Did either of you ever figure out a work-around for this? I'm looking into the same thing right now. Surprised more people haven't complained about this to be honest.