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 2015/03/07 02:04:23 UTC
ios commit: CB-7000 - Remove deprecated CDVPlugin and CDVPluginResult
methods
Repository: cordova-ios
Updated Branches:
refs/heads/4.0.x ef66b33cb -> ffdf7742f
CB-7000 - Remove deprecated CDVPlugin and CDVPluginResult methods
Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/ffdf7742
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/ffdf7742
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/ffdf7742
Branch: refs/heads/4.0.x
Commit: ffdf7742fecee6dc75e2fb31686aec1a13d2560f
Parents: ef66b33
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Fri Mar 6 17:04:23 2015 -0800
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Fri Mar 6 17:04:23 2015 -0800
----------------------------------------------------------------------
CordovaLib/Classes/CDVPlugin.h | 10 -------
CordovaLib/Classes/CDVPlugin.m | 19 -------------
CordovaLib/Classes/CDVPluginResult.h | 7 -----
CordovaLib/Classes/CDVPluginResult.m | 47 -------------------------------
4 files changed, 83 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ffdf7742/CordovaLib/Classes/CDVPlugin.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVPlugin.h b/CordovaLib/Classes/CDVPlugin.h
index b87685b..b281923 100644
--- a/CordovaLib/Classes/CDVPlugin.h
+++ b/CordovaLib/Classes/CDVPlugin.h
@@ -24,10 +24,6 @@
#import "CDVCommandDelegate.h"
#import "CDVWebViewEngineProtocol.h"
-#ifdef __IPHONE_8_0
- #import <WebKit/WebKit.h>
-#endif
-
@interface UIView (org_apache_cordova_UIView_Extension)
@property (nonatomic, weak) UIScrollView* scrollView;
@@ -71,10 +67,4 @@ extern NSString* const CDVRemoteNotificationError;
- (id)appDelegate;
-- (NSString*)writeJavascript:(NSString*)javascript CDV_DEPRECATED(3.6, "Use the CDVCommandDelegate equivalent of evalJs:. This will be removed in 4.0.0");
-
-- (NSString*)success:(CDVPluginResult*)pluginResult callbackId:(NSString*)callbackId CDV_DEPRECATED(3.6, "Use the CDVCommandDelegate equivalent of sendPluginResult:callbackId. This will be removed in 4.0.0");
-
-- (NSString*)error:(CDVPluginResult*)pluginResult callbackId:(NSString*)callbackId CDV_DEPRECATED(3.6, "Use the CDVCommandDelegate equivalent of sendPluginResult:callbackId. This will be removed in 4.0.0");
-
@end
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ffdf7742/CordovaLib/Classes/CDVPlugin.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVPlugin.m b/CordovaLib/Classes/CDVPlugin.m
index 03c0c73..8cc2eac 100644
--- a/CordovaLib/Classes/CDVPlugin.m
+++ b/CordovaLib/Classes/CDVPlugin.m
@@ -152,25 +152,6 @@ NSString* const CDVRemoteNotificationError = @"CDVRemoteNotificationError";
return [[UIApplication sharedApplication] delegate];
}
-- (NSString*)writeJavascript:(NSString*)javascript
-{
- // TODO: although deprecated, should have some solution here instead of removing it
- [((CDVViewController*)self.viewController).webViewEngine evaluateJavaScript:javascript completionHandler:nil]; // bad cast, but ok for now
- return @"";
-}
-
-- (NSString*)success:(CDVPluginResult*)pluginResult callbackId:(NSString*)callbackId
-{
- [self.commandDelegate evalJs:[pluginResult toSuccessCallbackString:callbackId]];
- return @"";
-}
-
-- (NSString*)error:(CDVPluginResult*)pluginResult callbackId:(NSString*)callbackId
-{
- [self.commandDelegate evalJs:[pluginResult toErrorCallbackString:callbackId]];
- return @"";
-}
-
// default implementation does nothing, ideally, we are not registered for notification if we aren't going to do anything.
// - (void)didReceiveLocalNotification:(NSNotification *)notification
// {
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ffdf7742/CordovaLib/Classes/CDVPluginResult.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVPluginResult.h b/CordovaLib/Classes/CDVPluginResult.h
index e624d4d..7377b12 100644
--- a/CordovaLib/Classes/CDVPluginResult.h
+++ b/CordovaLib/Classes/CDVPluginResult.h
@@ -61,11 +61,4 @@ typedef enum {
- (NSString*)argumentsAsJSON;
-// These methods are used by the legacy plugin return result method
-- (NSString*)toJSONString CDV_DEPRECATED(3.6, "Only used by toSuccessCallbackString and toErrorCallbackString which are deprecated. This will be removed in 4.0.0");
-
-- (NSString*)toSuccessCallbackString:(NSString*)callbackId CDV_DEPRECATED(3.6, "Use the CDVCommandDelegate method sendPluginResult:callbackId instead. This will be removed in 4.0.0");
-
-- (NSString*)toErrorCallbackString:(NSString*)callbackId CDV_DEPRECATED(3.6, "Use the CDVCommandDelegate method sendPluginResult:callbackId instead. This will be removed in 4.0.0");
-
@end
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ffdf7742/CordovaLib/Classes/CDVPluginResult.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVPluginResult.m b/CordovaLib/Classes/CDVPluginResult.m
index bba70e3..f200c04 100644
--- a/CordovaLib/Classes/CDVPluginResult.m
+++ b/CordovaLib/Classes/CDVPluginResult.m
@@ -163,53 +163,6 @@ id messageFromMultipart(NSArray* theMessages)
return argumentsJSON;
}
-// These methods are used by the legacy plugin return result method
-- (NSString*)toJSONString
-{
- NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:
- self.status, @"status",
- self.message ? self.message : [NSNull null], @"message",
- self.keepCallback, @"keepCallback",
- nil];
-
- NSError* error = nil;
- NSData* jsonData = [NSJSONSerialization dataWithJSONObject:dict
- options:NSJSONWritingPrettyPrinted
- error:&error];
- NSString* resultString = nil;
-
- if (error != nil) {
- NSLog(@"toJSONString error: %@", [error localizedDescription]);
- } else {
- resultString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
- }
-
- if ([[self class] isVerbose]) {
- NSLog(@"PluginResult:toJSONString - %@", resultString);
- }
- return resultString;
-}
-
-- (NSString*)toSuccessCallbackString:(NSString*)callbackId
-{
- NSString* successCB = [NSString stringWithFormat:@"cordova.callbackSuccess('%@',%@);", callbackId, [self toJSONString]];
-
- if ([[self class] isVerbose]) {
- NSLog(@"PluginResult toSuccessCallbackString: %@", successCB);
- }
- return successCB;
-}
-
-- (NSString*)toErrorCallbackString:(NSString*)callbackId
-{
- NSString* errorCB = [NSString stringWithFormat:@"cordova.callbackError('%@',%@);", callbackId, [self toJSONString]];
-
- if ([[self class] isVerbose]) {
- NSLog(@"PluginResult toErrorCallbackString: %@", errorCB);
- }
- return errorCB;
-}
-
static BOOL gIsVerbose = NO;
+ (void)setVerbose:(BOOL)verbose
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org