From 49f11ea42fdb8a8c96575d3f6f2541657f878d00 Mon Sep 17 00:00:00 2001 From: xucz Date: Thu, 27 Jun 2024 18:01:20 +0800 Subject: [PATCH] [iOS][OC]fix metadata receive crash(NMS-21946). --- .../Examples/Advanced/VideoMetadata/VideoMetadata.m | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/VideoMetadata/VideoMetadata.m b/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/VideoMetadata/VideoMetadata.m index fda2c9f86..d210ce78c 100644 --- a/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/VideoMetadata/VideoMetadata.m +++ b/iOS/APIExample-OC/APIExample-OC/Examples/Advanced/VideoMetadata/VideoMetadata.m @@ -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