[TIMOB-1900] Application Events: Close, Resume, Pause - Pause never fired
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-03-13T12:14:20.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 2.0.0, Sprint 2012-06 |
Components | iOS |
Labels | reported-1.4.0 |
Reporter | Lars Schwarz |
Assignee | Stephen Tramer |
Created | 2011-04-15T03:05:04.000+0000 |
Updated | 2012-03-14T10:05:32.000+0000 |
Description
To me it seems like the pause event is never fired. The only
event fired is the resume event. Close only seems to be fired when
the UIBackgroundModes have been set.
Tested using iOS SDK 4.1, Titanium SDK 1.4.0 on iPhone 3GS.
Assigning to Ralf for triage
I think I am seeing the same problem. Titanium kind of fires the pause event (I'm seeing the "[DEBUG] fire app event: pause" from AppModule.m) but then the actual pause listeners in my code don't get called. So far I've been able to trace it throughout AppModule.m and then TiHost.m, there it still calls fireEvent for all pause listeners. After that, I'm not sure where I have to look. Sometimes, though (maybe 5% of the time) the pause listeners actually get called. When not, they'll get called upon resume (before the resume listeners get called). This is a problem since I'm trying to set a flag whether the app paused correctly or some crash occurred, so it's pretty important to me. The workaround so far was to disable pausing the app via the Info.plist, but that's not really a good solution. Any ideas what might cause this?
This is a well-known issue that has to do with internal threading interactions. We're working on resolving it. There is a build which fixes this issue but we are in the process of backing out the change due to performance hits.
Part of the PR #1597 omnibus (https://github.com/appcelerator/titanium_mobile/pull/1597) wrt "pause" which is the only event that is no longer correctly triggered.
Combined pull #1597 + #1645
Closing bug. Verified fix in TIMOB-1542 and TIMOB-4538.