Explorar el Código

fix. ios receive NSData

matrixbirds hace 5 años
padre
commit
f324921d17
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4
    4
      ios/RCTAgora/RCTAgora.m

+ 4
- 4
ios/RCTAgora/RCTAgora.m Ver fichero

@@ -2401,11 +2401,11 @@ RCT_EXPORT_METHOD(setCameraCapturerConfiguration:(NSDictionary *)config
2401 2401
 }
2402 2402
 
2403 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 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 2411
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurStreamMessageErrorFromUid:(NSUInteger)uid streamId:(NSInteger)streamId error:(NSInteger)error missed:(NSInteger)missed cached:(NSInteger)cached {