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:09:21 UTC
[4/4] ios commit: Fixed pause and resume event firing to use cordova
channels onPause and onResume
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/590d087f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/590d087f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/590d087f
Branch: refs/heads/master
Commit: 590d087f2e379c84fd11f02442ba54e3b263959e
Parents: 791818a
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:08:54 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/590d087f/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();"];
}
// ///////////////////////