#4 Upgrading the JS API to prepare for custom options (no additional options yet, this is a change to make that possible in the future)

This commit is contained in:
eddyverbruggen@gmail.com
2015-04-22 21:51:38 +02:00
parent 75819ee95e
commit 6d4c052a12
4 changed files with 93 additions and 21 deletions
+5 -3
View File
@@ -6,9 +6,11 @@
- (void)show:(CDVInvokedUrlCommand*)command {
NSString *message = [command.arguments objectAtIndex:0];
NSString *duration = [command.arguments objectAtIndex:1];
NSString *position = [command.arguments objectAtIndex:2];
NSDictionary* options = [command.arguments objectAtIndex:0];
NSString *message = [options objectForKey:@"message"];
NSString *duration = [options objectForKey:@"duration"];
NSString *position = [options objectForKey:@"position"];
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'"];