Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A09BCD4CF for ; Sat, 25 Aug 2012 00:00:48 +0000 (UTC) Received: (qmail 65395 invoked by uid 500); 25 Aug 2012 00:00:47 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 65297 invoked by uid 500); 25 Aug 2012 00:00:47 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 64783 invoked by uid 99); 25 Aug 2012 00:00:47 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Aug 2012 00:00:46 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CA7FE1FEC8; Sat, 25 Aug 2012 00:00:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: anis@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [16/50] [abbrv] docs commit: [CB-541] Add iOS Quirk for resume event Message-Id: <20120825000046.CA7FE1FEC8@tyr.zones.apache.org> Date: Sat, 25 Aug 2012 00:00:46 +0000 (UTC) [CB-541] Add iOS Quirk for resume event Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/commit/8fc9ea95 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/tree/8fc9ea95 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/diff/8fc9ea95 Branch: refs/heads/master Commit: 8fc9ea950639cf3f0fc5bd9af2e8557ba02839b1 Parents: 5d76b66 Author: Shazron Abdullah Authored: Wed Aug 15 14:37:51 2012 -0700 Committer: Anis Kadri Committed: Fri Aug 24 16:59:40 2012 -0700 ---------------------------------------------------------------------- docs/en/2.0.0/cordova/events/events.resume.md | 11 +++++++++++ docs/en/edge/cordova/events/events.resume.md | 11 +++++++++++ 2 files changed, 22 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/8fc9ea95/docs/en/2.0.0/cordova/events/events.resume.md ---------------------------------------------------------------------- diff --git a/docs/en/2.0.0/cordova/events/events.resume.md b/docs/en/2.0.0/cordova/events/events.resume.md index 899094e..28bcab8 100644 --- a/docs/en/2.0.0/cordova/events/events.resume.md +++ b/docs/en/2.0.0/cordova/events/events.resume.md @@ -95,3 +95,14 @@ Any calls to console.log during your **pause** event handler will be run now whe This iOS specific event is available as a variant of the **resume** event, and is often used to detect when the "Lock" button has been pressed to unlock the device when your app is the foreground app. If your app (and device) is enabled for multi-tasking, this will be paired with a subsequent **resume** event, but only under iOS 5 (effectively all "locked" apps in iOS 5 that have multi-tasking enabled are put to the background). Under iOS 5, if you want your app to still run when the device is locked, you will have to disable multi-tasking (UIApplicationExitsOnSuspend - YES) for your app. This is different when you are on iOS 4 - to have your app run when the device is locked, the multi-tasking setting for your app does not matter. + +- __resume__ event + + Interactive functions like alert() when the resume event fires will need to be wrapped in a setTimeout call with a timeout value of zero, or else the app will hang. e.g. + + document.addEventListener("resume", onResume, false); + function onResume() { + setTimeout(function() { + // TODO: do your thing! + }, 0); + } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-docs/blob/8fc9ea95/docs/en/edge/cordova/events/events.resume.md ---------------------------------------------------------------------- diff --git a/docs/en/edge/cordova/events/events.resume.md b/docs/en/edge/cordova/events/events.resume.md index 899094e..28bcab8 100644 --- a/docs/en/edge/cordova/events/events.resume.md +++ b/docs/en/edge/cordova/events/events.resume.md @@ -95,3 +95,14 @@ Any calls to console.log during your **pause** event handler will be run now whe This iOS specific event is available as a variant of the **resume** event, and is often used to detect when the "Lock" button has been pressed to unlock the device when your app is the foreground app. If your app (and device) is enabled for multi-tasking, this will be paired with a subsequent **resume** event, but only under iOS 5 (effectively all "locked" apps in iOS 5 that have multi-tasking enabled are put to the background). Under iOS 5, if you want your app to still run when the device is locked, you will have to disable multi-tasking (UIApplicationExitsOnSuspend - YES) for your app. This is different when you are on iOS 4 - to have your app run when the device is locked, the multi-tasking setting for your app does not matter. + +- __resume__ event + + Interactive functions like alert() when the resume event fires will need to be wrapped in a setTimeout call with a timeout value of zero, or else the app will hang. e.g. + + document.addEventListener("resume", onResume, false); + function onResume() { + setTimeout(function() { + // TODO: do your thing! + }, 0); + } \ No newline at end of file