Skip to content

Commit

Permalink
[native] Fix sending videos on iOS 18
Browse files Browse the repository at this point in the history
Summary: On iOS 18 getAssetInfoAsync returns uri with a weird #YnBsaXN... suffix. This looks like iOS bug so for now to mitigate it we simply remove the suffix.

Test Plan: Send video on iOS 18 and 15.

Reviewers: tomek, kamil, ashoat

Reviewed By: ashoat

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D13786
  • Loading branch information
graszka22 committed Oct 24, 2024
1 parent 055d525 commit fad6010
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion native/media/file-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ async function fetchAssetInfo(mediaNativeID: string): Promise<{
try {
const assetInfo = await MediaLibrary.getAssetInfoAsync(mediaNativeID);
success = true;
localURI = assetInfo.localUri;
// on iOS18 getAssetInfoAsync returns uri with a weird #YnBsaXN... suffix
// this looks like iOS bug, so to mitigate it for now we simply remove
// the suffix
// https://github.com/expo/expo/issues/31857
// https://forums.developer.apple.com/forums/thread/760499
localURI = assetInfo.localUri.replace(/#.*$/, '');
if (Platform.OS === 'ios') {
orientation = assetInfo.orientation;
} else {
Expand Down

0 comments on commit fad6010

Please sign in to comment.