Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[expo-media-library] Add isNetworkAsset flag to ios #8800

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/expo-media-library/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

### 🎉 New features

- Added `isNetworkAsset` key for `AssetInfo` result from `getAssetInfoAsync`. ([#8800])(https://github.com/expo/expo/pull/8800) by [@jarvisluong](https://github.com/jarvisluong)

### 🐛 Bug fixes

## 8.2.1 — 2020-05-29
Expand Down
1 change: 1 addition & 0 deletions packages/expo-media-library/build/MediaLibrary.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/expo-media-library/build/MediaLibrary.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ - (NSDictionary *)constantsToExport
completionHandler:^(PHContentEditingInput * _Nullable contentEditingInput, NSDictionary * _Nonnull info) {
result[@"localUri"] = [contentEditingInput.fullSizeImageURL absoluteString];
result[@"orientation"] = @(contentEditingInput.fullSizeImageOrientation);
result[@"isNetworkAsset"] = [info objectForKey:PHContentEditingInputResultIsInCloudKey];

CIImage *ciImage = [CIImage imageWithContentsOfURL:contentEditingInput.fullSizeImageURL];
result[@"exif"] = ciImage.properties;
Expand All @@ -424,6 +425,7 @@ - (NSDictionary *)constantsToExport
resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) {
AVURLAsset *urlAsset = (AVURLAsset *)asset;
result[@"localUri"] = [[urlAsset URL] absoluteString];
result[@"isNetworkAsset"] = [info objectForKey:PHImageResultIsInCloudKey];
resolve(result);
}];
}
Expand Down
1 change: 1 addition & 0 deletions packages/expo-media-library/src/MediaLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type AssetInfo = Asset & {
location?: Location;
exif?: object;
isFavorite?: boolean; //iOS only
isNetworkAsset?: boolean; //iOS only
};

export type Location = {
Expand Down