cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/2] cordova-plugin-media-capture git commit: CB-8351 ios: Stop using (newly) deprecated CDVJSON.h
Date Tue, 27 Jan 2015 16:35:25 GMT
Repository: cordova-plugin-media-capture
Updated Branches:
  refs/heads/master 734e59852 -> 3374bf41d


CB-8351 ios: Stop using (newly) deprecated CDVJSON.h


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/commit/0f187eb4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/tree/0f187eb4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/diff/0f187eb4

Branch: refs/heads/master
Commit: 0f187eb4335de45004a9036fe2650152d1e376d4
Parents: 734e598
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Jan 27 11:34:54 2015 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Jan 27 11:34:54 2015 -0500

----------------------------------------------------------------------
 src/ios/CDVCapture.m | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture/blob/0f187eb4/src/ios/CDVCapture.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVCapture.m b/src/ios/CDVCapture.m
index c3980d3..48dd65f 100644
--- a/src/ios/CDVCapture.m
+++ b/src/ios/CDVCapture.m
@@ -19,7 +19,6 @@
 
 #import "CDVCapture.h"
 #import "CDVFile.h"
-#import <Cordova/CDVJSON.h>
 #import <Cordova/CDVAvailability.h>
 
 #define kW3CMediaFormatHeight @"height"
@@ -342,7 +341,11 @@
         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];
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message