Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11573] Ti API: iOS 'focus' event on window is not called after resume

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2013-02-12T20:05:21.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 04 API, 2013 Sprint 04
ComponentsTiAPI
Labelsapi, parity
ReporterArthur Evans
AssigneeVishal Duggal
Created2012-10-24T23:56:24.000+0000
Updated2013-03-27T22:29:09.000+0000

Description

This was filed as a doc bug (see linked issue) with the justification that this was the expected behavior on iOS. However, the Android behavior does not match--blur and focus are fired on the window when the app is paused and restarted. Before we address this in docs, I think we need an architectural decision on the correct behavior.

Original Bug Description

*Issue of the customer:* It seems the focus event does not get called on the active tab window when an app is resumed. For example: 1.I load my app, and the window in tab 1 triggers on the focus event 2.I then background my app, without leaving this window 3.I then move the app back to the foreground. Even though the window now has focus, the focus event is not fired. Is this by design or an issue? It seems that the focus event should fire as it is receiving focus again. *Attached sample code to reproduce this issue:* app.js: http://pastebin.com/1x8KJNXL test.js: http://pastebin.com/ShaypcYE *Summarized reply from platform team:* This is the expected behavior, it is by design. When you put an app into background, it is using the underlying pause/resume feature of iOS, this causes the 'focus' event not to trigger when you put it back into the foreground. *Reason why I created this ticket:* This isn't documented anywhere, at least I was unable to find anything when searching the wiki. It would be nice if this would be documented somewhere and easy to find, for future reference.

Comments

  1. Vishal Duggal 2012-12-06

    iOS does not fire focus on resume because it never fires blur on pause. This is an event parity problem and should be discussed and addressed as part of TIMOB-10373
  2. Vishal Duggal 2012-12-06

    On Android window state events are tied to activity/app lifecycle but on iOS they are not. When addressing TIMOB-10373 we should discuss if iOS should follow similar behavior
  3. Vishal Duggal 2013-02-12

    On iOS the focus blur events are tied to the view(Will/Did)Appear and view(Will/Did)Disappear methods. When the app is backgrounded and resumed these methods are not called and hence no blur/focus events are fired.

JSON Source