Update YouTubeNativeShare from 0.2.4 to 0.2.6

This commit is contained in:
aricloverEXALT 2025-01-07 01:05:40 -06:00 committed by GitHub
parent c421c86843
commit c397afd2f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,7 +99,8 @@ typedef NS_ENUM(NSInteger, ShareEntityType) {
ShareEntityFieldPlaylist = 2,
ShareEntityFieldChannel = 3,
ShareEntityFieldPost = 6,
ShareEntityFieldClip = 8
ShareEntityFieldClip = 8,
ShareEntityFieldShortFlag = 10
};
static inline NSString* extractIdWithFormat(GPBUnknownFields *fields, NSInteger fieldNumber, NSString *format) {
@ -137,8 +138,12 @@ static BOOL showNativeShareSheet(NSString *serializedShareEntity, UIView *source
}
}
if (!shareUrl)
shareUrl = extractIdWithFormat(fields, ShareEntityFieldVideo, @"https://youtube.com/watch?v=%@");
if (!shareUrl) {
NSString *format = @"https://youtube.com/watch?v=%@";
if ([fields fields:ShareEntityFieldShortFlag])
format = @"https://youtube.com/shorts/%@";
shareUrl = extractIdWithFormat(fields, ShareEntityFieldVideo, format);
}
if (!shareUrl)
shareUrl = extractIdWithFormat(fields, ShareEntityFieldPost, @"https://youtube.com/post/%@");