diff options
author | Struan Donald <struan@exo.org.uk> | 2013-03-25 15:57:26 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-03-25 17:13:56 +0000 |
commit | 73e3d5d4077636487f07be1beff3b2714ee2b276 (patch) | |
tree | 4b4529f36ab68ec7c2a9e51bcfafbd57d9336cc8 /iPhone/CordovaLib/Classes/CDVPlugin.m | |
parent | e5d7b3b62be5025f31c39b50ea3955398bc7cf40 (diff) |
upgrade to phonegap 2.5 for ios
Diffstat (limited to 'iPhone/CordovaLib/Classes/CDVPlugin.m')
-rwxr-xr-x | iPhone/CordovaLib/Classes/CDVPlugin.m | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/iPhone/CordovaLib/Classes/CDVPlugin.m b/iPhone/CordovaLib/Classes/CDVPlugin.m index 53023c7..a42d241 100755 --- a/iPhone/CordovaLib/Classes/CDVPlugin.m +++ b/iPhone/CordovaLib/Classes/CDVPlugin.m @@ -26,16 +26,12 @@ @end @implementation CDVPlugin -@synthesize webView, settings, viewController, commandDelegate, hasPendingOperation; +@synthesize webView, viewController, commandDelegate, hasPendingOperation; +// Do not override these methods. Use pluginInitialize instead. - (CDVPlugin*)initWithWebView:(UIWebView*)theWebView settings:(NSDictionary*)classSettings { - self = [self initWithWebView:theWebView]; - if (self) { - self.settings = classSettings; - self.hasPendingOperation = NO; - } - return self; + return [self initWithWebView:theWebView]; } - (CDVPlugin*)initWithWebView:(UIWebView*)theWebView @@ -48,26 +44,29 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onReset) name:CDVPluginResetNotification object:nil]; self.webView = theWebView; - - // You can listen to more app notifications, see: - // http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006728-CH3-DontLinkElementID_4 - - /* - // NOTE: if you want to use these, make sure you uncomment the corresponding notification handler - - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause) name:UIApplicationDidEnterBackgroundNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume) name:UIApplicationWillEnterForegroundNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationWillChange) name:UIApplicationWillChangeStatusBarOrientationNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationDidChange) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; - - // Added in 2.3.0+ - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveLocalNotification:) name:CDVLocalNotification object:nil]; - - */ } return self; } +- (void)pluginInitialize +{ + // You can listen to more app notifications, see: + // http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006728-CH3-DontLinkElementID_4 + + // NOTE: if you want to use these, make sure you uncomment the corresponding notification handler + + // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onPause) name:UIApplicationDidEnterBackgroundNotification object:nil]; + // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onResume) name:UIApplicationWillEnterForegroundNotification object:nil]; + // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationWillChange) name:UIApplicationWillChangeStatusBarOrientationNotification object:nil]; + // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onOrientationDidChange) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil]; + + // Added in 2.3.0 + // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveLocalNotification:) name:CDVLocalNotification object:nil]; + + // Added in 2.5.0 + // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad:) name:CDVPageDidLoadNotification object:nil]; +} + - (void)dispose { viewController = nil; @@ -140,9 +139,9 @@ } // default implementation does nothing, ideally, we are not registered for notification if we aren't going to do anything. -//- (void)didReceiveLocalNotification:(NSNotification *)notification -//{ +// - (void)didReceiveLocalNotification:(NSNotification *)notification +// { // // UILocalNotification* localNotification = [notification object]; // get the payload as a LocalNotification -//} +// } @end |