Skip to content

Commit

Permalink
fix. iOS binding
Browse files Browse the repository at this point in the history
  • Loading branch information
Matrixbirds committed Mar 26, 2019
1 parent 44a4b52 commit 0a010a7
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions ios/RCTAgora/RCTAgora.m
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ - (NSDictionary *)constantsToExport {

// get audio mixing duration
RCT_EXPORT_METHOD(getAudioMixingDuration
: (RCTPromiseResolveBlock)resolve
:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
NSInteger res = [self.rtcEngine getAudioMixingDuration];
if (res != 0) {
Expand Down Expand Up @@ -1387,7 +1387,8 @@ - (NSDictionary *)constantsToExport {

// isCameraZoomSupported
RCT_EXPORT_METHOD(isCameraZoomSupported
:(RCTPromiseResolveBlock)resolve) {
:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
BOOL res = [self.rtcEngine isCameraZoomSupported];
resolve(@{
@"success": @(YES),
Expand All @@ -1398,7 +1399,8 @@ - (NSDictionary *)constantsToExport {

// isCameraTorchSupported
RCT_EXPORT_METHOD(isCameraTorchSupported
:(RCTPromiseResolveBlock)resolve) {
:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
BOOL res = [self.rtcEngine isCameraTorchSupported];
resolve(@{
@"success": @(YES),
Expand All @@ -1408,7 +1410,8 @@ - (NSDictionary *)constantsToExport {

// isCameraFocusSupported
RCT_EXPORT_METHOD(isCameraFocusSupported
:(RCTPromiseResolveBlock)resolve) {
:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
BOOL res = [self.rtcEngine isCameraFocusPositionInPreviewSupported];
resolve(@{
@"success": @(YES),
Expand All @@ -1418,7 +1421,8 @@ - (NSDictionary *)constantsToExport {

// isCameraExposurePositionSupported
RCT_EXPORT_METHOD(isCameraExposurePositionSupported
:(RCTPromiseResolveBlock)resolve) {
:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
BOOL res = [self.rtcEngine isCameraExposurePositionSupported];
resolve(@{
@"success": @(YES),
Expand All @@ -1428,7 +1432,8 @@ - (NSDictionary *)constantsToExport {

// isCameraAutoFocusFaceModeSupported
RCT_EXPORT_METHOD(isCameraAutoFocusFaceModeSupported
:(RCTPromiseResolveBlock)resolve) {
:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
BOOL res = [self.rtcEngine isCameraAutoFocusFaceModeSupported];
resolve(@{
@"success": @(YES),
Expand All @@ -1439,7 +1444,8 @@ - (NSDictionary *)constantsToExport {
// setCameraZoomFactor
RCT_EXPORT_METHOD(setCameraZoomFactor
:(float)zoomFactor
resolve:(RCTPromiseResolveBlock)resolve) {
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
BOOL res = [self.rtcEngine setCameraZoomFactor:(CGFloat)zoomFactor];
resolve(@{
@"success": @(YES),
Expand All @@ -1450,7 +1456,8 @@ - (NSDictionary *)constantsToExport {
// setCameraFocusPositionInPreview
RCT_EXPORT_METHOD(setCameraFocusPositionInPreview
:(NSDictionary *)options
resolve:(RCTPromiseResolveBlock)resolve) {
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
BOOL res = [self.rtcEngine setCameraFocusPositionInPreview:CGPointMake((CGFloat)[options[@"x"] floatValue], (CGFloat)[options[@"y"] floatValue])];
resolve(@{
@"success": @(YES),
Expand All @@ -1461,7 +1468,8 @@ - (NSDictionary *)constantsToExport {
// setCameraExposurePosition
RCT_EXPORT_METHOD(setCameraExposurePosition
:(NSDictionary *)options
resolve:(RCTPromiseResolveBlock)resolve) {
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
BOOL res = [self.rtcEngine setCameraExposurePosition:CGPointMake((CGFloat)[options[@"x"] floatValue], (CGFloat)[options[@"y"] floatValue])];
resolve(@{
@"success": @(YES),
Expand Down

0 comments on commit 0a010a7

Please sign in to comment.