mirror of
https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git
synced 2026-07-31 00:02:14 +08:00
#18 - fixed cordova 3.6.0 deprecation warnings, so we're ready for Cordova 4.x
This commit is contained in:
+4
-4
@@ -12,7 +12,7 @@
|
||||
|
||||
if (![position isEqual: @"top"] && ![position isEqual: @"center"] && ![position isEqual: @"bottom"]) {
|
||||
CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"invalid position. valid options are 'top', 'center' and 'bottom'"];
|
||||
[self writeJavascript:[pluginResult toErrorCallbackString:command.callbackId]];
|
||||
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
durationInt = 5;
|
||||
} else {
|
||||
CDVPluginResult * pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:@"invalid duration. valid options are 'short' and 'long'"];
|
||||
[self writeJavascript:[pluginResult toErrorCallbackString:command.callbackId]];
|
||||
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
|
||||
return;
|
||||
}
|
||||
|
||||
[self.webView makeToast:message duration:durationInt position:position];
|
||||
|
||||
|
||||
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
|
||||
[self writeJavascript:[pluginResult toSuccessCallbackString:command.callbackId]];
|
||||
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user