From e0e645ce6404ecdca2cf890610240e0226578e38 Mon Sep 17 00:00:00 2001 From: Jan Wiebe Date: Mon, 25 Mar 2024 17:35:10 +0100 Subject: [PATCH] Fix size mapping to react native --- packages/react-native-carplay/ios/RNCarPlay.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/react-native-carplay/ios/RNCarPlay.m b/packages/react-native-carplay/ios/RNCarPlay.m index 10263a2b..537c7bc8 100644 --- a/packages/react-native-carplay/ios/RNCarPlay.m +++ b/packages/react-native-carplay/ios/RNCarPlay.m @@ -726,7 +726,11 @@ - (void)updateListRowItemImageWithURL:(CPListImageRowItem *)item imgUrl:(NSStrin CPTemplate *template = [store findTemplateById:templateId]; if (template) { CPListTemplate *listTemplate = (CPListTemplate*) template; - resolve(@(CPListItem.maximumImageSize)); + NSDictionary *sizeDict = @{ + @"width": @(CPlistItem.maximumImageSize.width), + @"height": @(CPlistItem.maximumImageSize.height) + }; + resolve(sizeDict); } else { NSLog(@"Failed to find template %@", template); reject(@"template_not_found", @"Template not found in store", nil); @@ -767,7 +771,11 @@ - (void)updateListRowItemImageWithURL:(CPListImageRowItem *)item imgUrl:(NSStrin CPTemplate *template = [store findTemplateById:templateId]; if (template) { CPListTemplate *listTemplate = (CPListTemplate*) template; - resolve(@(CPListImageRowItem.maximumImageSize)); + NSDictionary *sizeDict = @{ + @"width": @(CPListImageRowItem.maximumImageSize.width), + @"height": @(CPListImageRowItem.maximumImageSize.height) + }; + resolve(sizeDict); } else { NSLog(@"Failed to find template %@", template); reject(@"template_not_found", @"Template not found in store", nil);