Skip to content

Commit

Permalink
[iOS][OC]fix metadata receive crash(NMS-21946).
Browse files Browse the repository at this point in the history
  • Loading branch information
xgfd3 committed Jun 27, 2024
1 parent 9a356cd commit 49f11ea
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,16 +215,12 @@ - (NSData *)readyToSendMetadataAtTimestamp:(NSTimeInterval)timestamp sourceType:
self.metadata = nil;
return metadata;
}
/// Callback when the local user receives the metadata.
/// @param data The received metadata.
/// @param uid The ID of the user who sends the metadata.
/// @param timestamp The timestamp (ms) of the received metadata.
- (void)receiveMetadata:(NSData *)data fromUser:(NSInteger)uid atTimestamp:(NSTimeInterval)timestamp {

- (void)didMetadataReceived:(AgoraMetadata * _Nonnull)metadata {
dispatch_async(dispatch_get_main_queue(), ^{
[LogUtil log: @"metadata received" level:LogLevelInfo];
NSString *message = [[NSString alloc] initWithData:data encoding:kCFStringEncodingUTF8];
NSString *message = [[NSString alloc] initWithData:metadata.data encoding:kCFStringEncodingUTF8];
[self showAlertWithTitle:@"Metadata received" message:message];
});
}

@end

0 comments on commit 49f11ea

Please sign in to comment.