Browse Source

fix. ios receive NSData

matrixbirds 5 years ago
parent
commit
f324921d17
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      ios/RCTAgora/RCTAgora.m

+ 4
- 4
ios/RCTAgora/RCTAgora.m View File

2401
 }
2401
 }
2402
 
2402
 
2403
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine receiveStreamMessageFromUid:(NSUInteger)uid streamId:(NSInteger)streamId data:(NSData *_Nonnull)data {
2403
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine receiveStreamMessageFromUid:(NSUInteger)uid streamId:(NSInteger)streamId data:(NSData *_Nonnull)data {
2404
+  NSString *_data = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
2404
   [self sendEvent:AGReceiveStreamMessage params:@{
2405
   [self sendEvent:AGReceiveStreamMessage params:@{
2405
-                                                @"uid": @(uid),
2406
-                                                @"streamId": @(streamId),
2407
-                                                @"data": data
2408
-                                                }];
2406
+                                                  @"uid": @(uid),
2407
+                                                  @"streamId": @(streamId),
2408
+                                                  @"data": _data}];
2409
 }
2409
 }
2410
 
2410
 
2411
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurStreamMessageErrorFromUid:(NSUInteger)uid streamId:(NSInteger)streamId error:(NSInteger)error missed:(NSInteger)missed cached:(NSInteger)cached {
2411
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurStreamMessageErrorFromUid:(NSUInteger)uid streamId:(NSInteger)streamId error:(NSInteger)error missed:(NSInteger)missed cached:(NSInteger)cached {