Skip to content
Permalink
Browse files
CB-8351 ios: Stop using (newly) deprecated CDVJSON.h
  • Loading branch information
agrieve committed Jan 27, 2015
1 parent 734e598 commit 0f187eb4335de45004a9036fe2650152d1e376d4
Showing 1 changed file with 5 additions and 2 deletions.
@@ -19,7 +19,6 @@ Licensed to the Apache Software Foundation (ASF) under one

#import "CDVCapture.h"
#import "CDVFile.h"
#import <Cordova/CDVJSON.h>
#import <Cordova/CDVAvailability.h>

#define kW3CMediaFormatHeight @"height"
@@ -342,7 +341,11 @@ - (void)getMediaModes:(CDVInvokedUrlCommand*)command
movieArray ? (NSObject*) movieArray:[NSNull null], @"video",
audioArray ? (NSObject*) audioArray:[NSNull null], @"audio",
nil];
NSString* jsString = [NSString stringWithFormat:@"navigator.device.capture.setSupportedModes(%@);", [modes JSONString]];

NSData* jsonData = [NSJSONSerialization dataWithJSONObject:modes options:0 error:nil];
NSString* jsonStr = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];

NSString* jsString = [NSString stringWithFormat:@"navigator.device.capture.setSupportedModes(%@);", jsonStr];
[self.commandDelegate evalJs:jsString];
}

0 comments on commit 0f187eb

Please sign in to comment.