You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/04/17 02:07:34 UTC

[1/4] ios commit: Fixed pause and resume event firing to use cordova channels onPause and onResume

Updated Branches:
  refs/heads/1.6.1 e2c803a11 -> 8747ba4c0


Fixed pause and resume event firing to use cordova channels onPause and onResume


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/8747ba4c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/8747ba4c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/8747ba4c

Branch: refs/heads/1.6.1
Commit: 8747ba4c03dbe33fb65c8b0ad13bb5e318632511
Parents: 9f57cdf
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Apr 16 17:07:21 2012 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Apr 16 17:07:21 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.m |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8747ba4c/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index a61cae5..fa2c006 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -929,7 +929,6 @@ static NSString* cdvVersion;
 - (void) onAppWillResignActive:(NSNotification*)notification
 {
     //NSLog(@"%@",@"applicationWillResignActive");
-    // TODO: uhh, wut? pause/resume not enough?
     [self.webView stringByEvaluatingJavaScriptFromString:@"cordova.fireDocumentEvent('resign');"];
 }
 
@@ -941,14 +940,13 @@ static NSString* cdvVersion;
 - (void) onAppWillEnterForeground:(NSNotification*)notification
 {
     //NSLog(@"%@",@"applicationWillEnterForeground");
-    [self.webView stringByEvaluatingJavaScriptFromString:@"cordova.fireDocumentEvent('resume');"];
+    [self.webView stringByEvaluatingJavaScriptFromString:@"cordova.require('cordova/channel').onResume.fire();"];
 }
 
 // This method is called to let your application know that it moved from the inactive to active state. 
 - (void) onAppDidBecomeActive:(NSNotification*)notification
 {
     //NSLog(@"%@",@"applicationDidBecomeActive");
-    // TODO: uhh, wut? pause/resume not enough?
     [self.webView stringByEvaluatingJavaScriptFromString:@"cordova.fireDocumentEvent('active');"];
 }
 
@@ -959,7 +957,7 @@ static NSString* cdvVersion;
 - (void) onAppDidEnterBackground:(NSNotification*)notification
 {
     //NSLog(@"%@",@"applicationDidEnterBackground");
-    [self.webView stringByEvaluatingJavaScriptFromString:@"cordova.fireDocumentEvent('pause');"];
+    [self.webView stringByEvaluatingJavaScriptFromString:@"cordova.require('cordova/channel').onPause.fire();"];
 }
 
 // ///////////////////////