Skip to content

Commit

Permalink
Merge pull request #99 from syanbo/hotfix/ios-type-cast
Browse files Browse the repository at this point in the history
hotfix/ios type cast crash
  • Loading branch information
Matrixbirds authored Sep 24, 2019
2 parents 7b344e0 + b375bb3 commit a78dc8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## THE CHANGELOG

#### 2.9.0-alpha.2
- fix ios dictionary stringValue type cast

#### 2.9.0-alpha.1
- fix typo: rename `methodisSpeakerphoneEnabled` to `isSpeakerphoneEnabled`
- events deprecated & instead:
Expand Down
14 changes: 7 additions & 7 deletions ios/RCTAgora/RCTAgora.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ - (NSDictionary *)constantsToExport {
}
}
if (options[@"secret"] != nil) {
[self.rtcEngine setEncryptionSecret:[options[@"secret"] stringValue]];
[self.rtcEngine setEncryptionSecret:[options[@"secret"]]];
if (options[@"secretMode"] != nil) {
[self.rtcEngine setEncryptionMode:[options[@"secretMode"] stringValue]];
[self.rtcEngine setEncryptionMode:[options[@"secretMode"]]];
}
}

Expand Down Expand Up @@ -851,7 +851,7 @@ - (NSDictionary *)constantsToExport {
RCT_EXPORT_METHOD(startAudioMixing:(NSDictionary *) options
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
NSInteger res = [self.rtcEngine startAudioMixing:[options[@"filepath"] stringValue]
NSInteger res = [self.rtcEngine startAudioMixing:[options[@"filepath"]]
loopback:[options[@"loopback"] boolValue]
replace:[options[@"replace"] boolValue]
cycle:[options[@"cycle"] integerValue]];
Expand Down Expand Up @@ -1038,7 +1038,7 @@ - (NSDictionary *)constantsToExport {
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
NSInteger res = [self.rtcEngine playEffect:(int)[options[@"soundid"] integerValue]
filePath:[options[@"filepath"] stringValue]
filePath:[options[@"filepath"]]
loopCount:(int)[options[@"loopcount"] integerValue]
pitch:[options[@"pitch"] doubleValue]
pan:[options[@"pan"] doubleValue]
Expand Down Expand Up @@ -1157,7 +1157,7 @@ - (NSDictionary *)constantsToExport {
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
AgoraAudioRecordingQuality qualityType = (AgoraAudioRecordingQuality)[options[@"quality"] integerValue];
NSInteger res = [self.rtcEngine startAudioRecording:[options[@"filepath"] stringValue] quality:qualityType];
NSInteger res = [self.rtcEngine startAudioRecording:[options[@"filepath"]] quality:qualityType];
if (res == 0) {
resolve(nil);
} else {
Expand Down Expand Up @@ -1374,7 +1374,7 @@ - (NSDictionary *)constantsToExport {
config.audioBitrate = [options[@"config"][@"audioBitrate"] integerValue];
config.audioChannels = [options[@"config"][@"audioChannels"] integerValue];

NSInteger res = [self.rtcEngine addInjectStreamUrl:[options[@"url"] stringValue]
NSInteger res = [self.rtcEngine addInjectStreamUrl:[options[@"url"]]
config:config];
if (res == 0) {
resolve(nil);
Expand Down Expand Up @@ -1630,7 +1630,7 @@ - (NSDictionary *)constantsToExport {
transcoding.transcodingUsers = transcodingUsers;
}
if ([options objectForKey:@"transcodingExtraInfo"]) {
transcoding.transcodingExtraInfo = [options[@"transcodingExtraInfo"] stringValue];
transcoding.transcodingExtraInfo = [options[@"transcodingExtraInfo"]];
}

NSInteger res = [self.rtcEngine setLiveTranscoding:transcoding];
Expand Down

0 comments on commit a78dc8e

Please sign in to comment.