expo-media-library 17.1.8-canary-20250709-136b77f → 17.2.0-canary-20250713-8f814f8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/android/build.gradle +2 -2
- package/build/MediaLibrary.d.ts +8 -2
- package/build/MediaLibrary.d.ts.map +1 -1
- package/build/MediaLibrary.js +2 -1
- package/build/MediaLibrary.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/MediaLibraryRecords.swift +69 -8
- package/ios/MediaLibraryUtilities.swift +30 -61
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.module → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.module} +7 -7
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.module.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.module.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.module.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.module.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.pom → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.pom} +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.pom.md5 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.pom.sha1 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.pom.sha256 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.pom.sha512 +1 -0
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/maven-metadata.xml +4 -4
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/maven-metadata.xml.sha512 +1 -1
- package/package.json +3 -3
- package/src/MediaLibrary.ts +13 -3
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.module.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.module.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.module.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.module.sha512 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.pom.md5 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.pom.sha1 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.pom.sha256 +0 -1
- package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.pom.sha512 +0 -1
- /package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f-sources.jar → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8-sources.jar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f-sources.jar.md5 → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8-sources.jar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f-sources.jar.sha1 → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8-sources.jar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f-sources.jar.sha256 → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8-sources.jar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f-sources.jar.sha512 → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8-sources.jar.sha512} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.aar → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.aar} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.aar.md5 → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.aar.md5} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.aar.sha1 → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.aar.sha1} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.aar.sha256 → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.aar.sha256} +0 -0
- /package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/{17.1.8-canary-20250709-136b77f/expo.modules.medialibrary-17.1.8-canary-20250709-136b77f.aar.sha512 → 17.2.0-canary-20250713-8f814f8/expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.aar.sha512} +0 -0
package/CHANGELOG.md
CHANGED
package/android/build.gradle
CHANGED
|
@@ -4,13 +4,13 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'host.exp.exponent'
|
|
7
|
-
version = '17.
|
|
7
|
+
version = '17.2.0-canary-20250713-8f814f8'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.medialibrary"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 37
|
|
13
|
-
versionName "17.
|
|
13
|
+
versionName "17.2.0-canary-20250713-8f814f8"
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
package/build/MediaLibrary.d.ts
CHANGED
|
@@ -124,9 +124,10 @@ export type AssetInfo = Asset & {
|
|
|
124
124
|
};
|
|
125
125
|
/**
|
|
126
126
|
* Constants identifying specific variations of asset media, such as panorama or screenshot photos,
|
|
127
|
-
* and time-lapse or high-frame-rate video. Maps to [
|
|
127
|
+
* and time-lapse or high-frame-rate video. Maps to [`PHAssetMediaSubtype`](https://developer.apple.com/documentation/photokit/phassetmediasubtype#1603888).
|
|
128
|
+
* @platform ios
|
|
128
129
|
* */
|
|
129
|
-
export type MediaSubtype = 'depthEffect' | 'hdr' | 'highFrameRate' | 'livePhoto' | 'panorama' | 'screenshot' | 'stream' | 'timelapse';
|
|
130
|
+
export type MediaSubtype = 'depthEffect' | 'hdr' | 'highFrameRate' | 'livePhoto' | 'panorama' | 'screenshot' | 'stream' | 'timelapse' | 'spatialMedia' | 'videoCinematic';
|
|
130
131
|
export type MediaLibraryAssetInfoQueryOptions = {
|
|
131
132
|
/**
|
|
132
133
|
* Whether allow the asset to be downloaded from network. Only available in iOS with iCloud assets.
|
|
@@ -240,6 +241,11 @@ export type AssetsOptions = {
|
|
|
240
241
|
* @default MediaType.photo
|
|
241
242
|
*/
|
|
242
243
|
mediaType?: MediaTypeValue[] | MediaTypeValue;
|
|
244
|
+
/**
|
|
245
|
+
* An array of [MediaSubtype](#mediasubtype)s or a single `MediaSubtype`.
|
|
246
|
+
* @platform ios
|
|
247
|
+
*/
|
|
248
|
+
mediaSubtypes?: MediaSubtype[] | MediaSubtype;
|
|
243
249
|
/**
|
|
244
250
|
* `Date` object or Unix timestamp in milliseconds limiting returned assets only to those that
|
|
245
251
|
* were created after this date.
|
|
@@ -1 +1 @@
|
|
|
1
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GAAG,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAyCjG;AAGD;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,6BAA6B,KAAK,IAAI,GACvD,iBAAiB,CAEnB;AAGD,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,iBAAiB,GAAG,IAAI,CAExE;AAGD;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAGD;;;;;GAKG;AACH,wBAAsB,eAAe,iBAMpC;AAGD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAM9E;AAGD;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAMhF"}
|
package/build/MediaLibrary.js
CHANGED
|
@@ -388,13 +388,14 @@ export async function getAssetsAsync(assetsOptions = {}) {
|
|
|
388
388
|
if (!MediaLibrary.getAssetsAsync) {
|
|
389
389
|
throw new UnavailabilityError('MediaLibrary', 'getAssetsAsync');
|
|
390
390
|
}
|
|
391
|
-
const { first, after, album, sortBy, mediaType, createdAfter, createdBefore } = assetsOptions;
|
|
391
|
+
const { first, after, album, sortBy, mediaType, createdAfter, createdBefore, mediaSubtypes } = assetsOptions;
|
|
392
392
|
const options = {
|
|
393
393
|
first: first == null ? 20 : first,
|
|
394
394
|
after: getId(after),
|
|
395
395
|
album: getId(album),
|
|
396
396
|
sortBy: arrayize(sortBy),
|
|
397
397
|
mediaType: arrayize(mediaType || [MediaType.photo]),
|
|
398
|
+
mediaSubtypes: arrayize(mediaSubtypes),
|
|
398
399
|
createdAfter: dateToNumber(createdAfter),
|
|
399
400
|
createdBefore: dateToNumber(createdBefore),
|
|
400
401
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaLibrary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AAC;AAED,cAAc;AACd;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CACzB,QAAwD;IAExD,OAAO,YAAY,CAAC,WAAW,CAAC,YAAY,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;AAC/E,CAAC;AAED,eAAe;AACf,MAAM,UAAU,kBAAkB,CAAC,YAA+B;IAChE,YAAY,CAAC,MAAM,EAAE,CAAC;AACxB,CAAC;AAED,cAAc;AACd;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,YAAY,CAAC,kBAAkB,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;AACrE,CAAC;AAED,cAAc;AACd;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,CAAC;QAClC,MAAM,IAAI,mBAAmB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,MAAM,YAAY,CAAC,eAAe,EAAE,CAAC;AAC9C,CAAC;AAED,cAAc;AACd;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,KAAe;IAC7D,IAAI,CAAC,YAAY,CAAC,yBAAyB,EAAE,CAAC;QAC5C,OAAO;IACT,CAAC;IAED,OAAO,MAAM,YAAY,CAAC,yBAAyB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,cAAc;AACd;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,KAAe;IAC5D,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,CAAC;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,MAAM,YAAY,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import {\n PermissionResponse as EXPermissionResponse,\n PermissionStatus,\n PermissionExpiration,\n PermissionHookOptions,\n createPermissionHook,\n UnavailabilityError,\n EventSubscription,\n} from 'expo-modules-core';\nimport { Platform } from 'react-native';\n\nimport MediaLibrary from './ExpoMediaLibrary';\n\nconst isExpoGo = typeof expo !== 'undefined' && globalThis.expo?.modules?.ExpoGo;\n\nlet loggedExpoGoWarning = false;\n\nif (isExpoGo && !loggedExpoGoWarning) {\n console.warn(\n 'Due to changes in Androids permission requirements, Expo Go can no longer provide full access to the media library. To test the full functionality of this module, you can create a development build. https://docs.expo.dev/develop/development-builds/create-a-build'\n );\n loggedExpoGoWarning = true;\n}\n\n// @needsAudit\nexport type PermissionResponse = EXPermissionResponse & {\n /**\n * Indicates if your app has access to the whole or only part of the photo library. Possible values are:\n * - `'all'` if the user granted your app access to the whole photo library\n * - `'limited'` if the user granted your app access only to selected photos (only available on Android API 14+ and iOS 14.0+)\n * - `'none'` if user denied or hasn't yet granted the permission\n */\n accessPrivileges?: 'all' | 'limited' | 'none';\n};\n\n/**\n * Determines the type of media that the app will ask the OS to get access to.\n * @platform android 13+\n */\nexport type GranularPermission = 'audio' | 'photo' | 'video';\n\nexport type MediaTypeValue = 'audio' | 'photo' | 'video' | 'unknown' | 'pairedVideo';\n\n/**\n * Represents the possible types of media that the app will ask the OS to get access to when calling [`presentPermissionsPickerAsync()`](#medialibrarypresentpermissionspickerasyncmediatypes).\n * @platform android 14+\n * */\nexport type MediaTypeFilter = 'photo' | 'video';\n\nexport type SortByKey =\n | 'default'\n | 'mediaType'\n | 'width'\n | 'height'\n | 'creationTime'\n | 'modificationTime'\n | 'duration';\nexport type SortByValue = [SortByKey, boolean] | SortByKey;\n\ntype InternalSortByValue = `${SortByKey} ${'ASC' | 'DESC'}`;\n\nexport type MediaTypeObject = {\n audio: 'audio';\n photo: 'photo';\n video: 'video';\n unknown: 'unknown';\n};\n\nexport type SortByObject = {\n default: 'default';\n mediaType: 'mediaType';\n width: 'width';\n height: 'height';\n creationTime: 'creationTime';\n modificationTime: 'modificationTime';\n duration: 'duration';\n};\n\n// @needsAudit\nexport type Asset = {\n /**\n * Internal ID that represents an asset.\n */\n id: string;\n /**\n * Filename of the asset.\n */\n filename: string;\n /**\n * URI that points to the asset. `ph://*` (iOS), `file://*` (Android)\n */\n uri: string;\n /**\n * Media type.\n */\n mediaType: MediaTypeValue;\n /**\n * An array of media subtypes.\n * @platform ios\n */\n mediaSubtypes?: MediaSubtype[];\n /**\n * Width of the image or video.\n */\n width: number;\n /**\n * Height of the image or video.\n */\n height: number;\n /**\n * File creation timestamp.\n */\n creationTime: number;\n /**\n * Last modification timestamp.\n */\n modificationTime: number;\n /**\n * Duration of the video or audio asset in seconds.\n */\n duration: number;\n /**\n * Album ID that the asset belongs to.\n * @platform android\n */\n albumId?: string;\n};\n\n// @needsAudit\nexport type AssetInfo = Asset & {\n /**\n * Local URI for the asset.\n */\n localUri?: string;\n /**\n * GPS location if available.\n */\n location?: Location;\n /**\n * EXIF metadata associated with the image.\n */\n exif?: object;\n /**\n * Whether the asset is marked as favorite.\n * @platform ios\n */\n isFavorite?: boolean;\n /**\n * This field is available only if flag `shouldDownloadFromNetwork` is set to `false`.\n * Whether the asset is stored on the network (iCloud on iOS).\n * @platform ios\n */\n isNetworkAsset?: boolean; //iOS only\n /**\n * Display orientation of the image. Orientation is available only for assets whose\n * `mediaType` is `MediaType.photo`. Value will range from 1 to 8, see [EXIF orientation specification](http://sylvana.net/jpegcrop/exif_orientation.html)\n * for more details.\n * @platform ios\n */\n orientation?: number;\n /**\n * Contains information about the video paired with the image file.\n * This field is available if the `mediaType` is `\"photo\"`, and the `mediaSubtypes` includes `\"livePhoto\"`.\n * @platform ios\n */\n pairedVideoAsset?: Asset | null;\n};\n\n/**\n * Constants identifying specific variations of asset media, such as panorama or screenshot photos,\n * and time-lapse or high-frame-rate video. Maps to [these values](https://developer.apple.com/documentation/photokit/phassetmediasubtype#1603888).\n * */\nexport type MediaSubtype =\n | 'depthEffect'\n | 'hdr'\n | 'highFrameRate'\n | 'livePhoto'\n | 'panorama'\n | 'screenshot'\n | 'stream'\n | 'timelapse';\n\n// @needsAudit\nexport type MediaLibraryAssetInfoQueryOptions = {\n /**\n * Whether allow the asset to be downloaded from network. Only available in iOS with iCloud assets.\n * @default true\n */\n shouldDownloadFromNetwork?: boolean;\n};\n\n// @needsAudit\nexport type MediaLibraryAssetsChangeEvent = {\n /**\n * Whether the media library's changes could be described as \"incremental changes\".\n * `true` indicates the changes are described by the `insertedAssets`, `deletedAssets` and\n * `updatedAssets` values. `false` indicates that the scope of changes is too large and you\n * should perform a full assets reload (eg. a user has changed access to individual assets in the\n * media library).\n */\n hasIncrementalChanges: boolean;\n /**\n * Available only if `hasIncrementalChanges` is `true`.\n * Array of [`Asset`](#asset)s that have been inserted to the library.\n */\n insertedAssets?: Asset[];\n /**\n * Available only if `hasIncrementalChanges` is `true`.\n * Array of [`Asset`](#asset)s that have been deleted from the library.\n */\n deletedAssets?: Asset[];\n /**\n * Available only if `hasIncrementalChanges` is `true`.\n * Array of [`Asset`](#asset)s that have been updated or completed downloading from network\n * storage (iCloud on iOS).\n */\n updatedAssets?: Asset[];\n};\n\n// @docsMissing\nexport type Location = {\n latitude: number;\n longitude: number;\n};\n\n// @needsAudit\nexport type Album = {\n /**\n * Album ID.\n */\n id: string;\n /**\n * Album title.\n */\n title: string;\n /**\n * Estimated number of assets in the album.\n */\n assetCount: number;\n /**\n * The type of the assets album.\n * @platform ios\n */\n type?: AlbumType;\n /**\n * Apply only to albums whose type is `'moment'`. Earliest creation timestamp of all\n * assets in the moment.\n * @platform ios\n */\n startTime: number;\n /**\n * Apply only to albums whose type is `'moment'`. Latest creation timestamp of all\n * assets in the moment.\n * @platform ios\n */\n endTime: number;\n /**\n * Apply only to albums whose type is `'moment'`. Approximated location of all\n * assets in the moment.\n * @platform ios\n */\n approximateLocation?: Location;\n /**\n * Apply only to albums whose type is `'moment'`. Names of locations grouped\n * in the moment.\n * @platform ios\n */\n locationNames?: string[];\n};\n\n// @docsMissing\nexport type AlbumType = 'album' | 'moment' | 'smartAlbum';\n\n// @docsMissing\nexport type AlbumsOptions = {\n includeSmartAlbums?: boolean;\n};\n\n// @needsAudit\nexport type AssetsOptions = {\n /**\n * The maximum number of items on a single page.\n * @default 20\n */\n first?: number;\n /**\n * Asset ID of the last item returned on the previous page. To get the ID of the next page,\n * pass [`endCursor`](#pagedinfo) as its value.\n */\n after?: AssetRef;\n /**\n * [Album](#album) or its ID to get assets from specific album.\n */\n album?: AlbumRef;\n /**\n * An array of [`SortByValue`](#sortbyvalue)s or a single `SortByValue` value. By default, all\n * keys are sorted in descending order, however you can also pass a pair `[key, ascending]` where\n * the second item is a `boolean` value that means whether to use ascending order. Note that if\n * the `SortBy.default` key is used, then `ascending` argument will not matter. Earlier items have\n * higher priority when sorting out the results.\n * If empty, this method uses the default sorting that is provided by the platform.\n */\n sortBy?: SortByValue[] | SortByValue;\n /**\n * An array of [MediaTypeValue](#mediatypevalue)s or a single `MediaTypeValue`.\n * @default MediaType.photo\n */\n mediaType?: MediaTypeValue[] | MediaTypeValue;\n /**\n * `Date` object or Unix timestamp in milliseconds limiting returned assets only to those that\n * were created after this date.\n */\n createdAfter?: Date | number;\n /**\n * Similarly as `createdAfter`, but limits assets only to those that were created before specified\n * date.\n */\n createdBefore?: Date | number;\n};\n\n// @needsAudit\nexport type PagedInfo<T> = {\n /**\n * A page of [`Asset`](#asset)s fetched by the query.\n */\n assets: T[];\n /**\n * ID of the last fetched asset. It should be passed as `after` option in order to get the\n * next page.\n */\n endCursor: string;\n /**\n * Whether there are more assets to fetch.\n */\n hasNextPage: boolean;\n /**\n * Estimated total number of assets that match the query.\n */\n totalCount: number;\n};\n\n// @docsMissing\nexport type AssetRef = Asset | string;\n\n// @docsMissing\nexport type AlbumRef = Album | string;\n\nexport {\n PermissionStatus,\n PermissionExpiration,\n EXPermissionResponse,\n PermissionHookOptions,\n EventSubscription as Subscription,\n};\n\nfunction arrayize<T>(item: T | T[]): T[] {\n if (Array.isArray(item)) {\n return item;\n }\n return item ? [item] : [];\n}\n\nfunction getId(ref: string | undefined | { id?: string }): string | undefined {\n if (typeof ref === 'string') {\n return ref;\n }\n return ref ? ref.id : undefined;\n}\n\nfunction checkAssetIds(assetIds: unknown[]): asserts assetIds is string[] {\n if (assetIds.some((id) => !id || typeof id !== 'string')) {\n throw new Error('Asset ID must be a string!');\n }\n}\n\nfunction checkAlbumIds(albumIds: unknown[]): asserts albumIds is string[] {\n if (albumIds.some((id) => !id || typeof id !== 'string')) {\n throw new Error('Album ID must be a string!');\n }\n}\n\nfunction checkMediaType(mediaType: unknown): asserts mediaType is keyof MediaTypeObject {\n if (Object.values(MediaType).indexOf(mediaType as any) === -1) {\n throw new Error(`Invalid mediaType: ${mediaType}`);\n }\n}\n\nfunction checkSortBy(sortBy: unknown): asserts sortBy is SortByValue {\n if (Array.isArray(sortBy)) {\n checkSortByKey(sortBy[0]);\n\n if (typeof sortBy[1] !== 'boolean') {\n throw new Error('Invalid sortBy array argument. Second item must be a boolean!');\n }\n } else {\n checkSortByKey(sortBy);\n }\n}\n\nfunction checkSortByKey(sortBy: any): void {\n if (Object.values(SortBy).indexOf(sortBy) === -1) {\n throw new Error(`Invalid sortBy key: ${sortBy}`);\n }\n}\n\nfunction sortByOptionToString(sortBy: SortByValue | undefined): InternalSortByValue {\n checkSortBy(sortBy);\n if (Array.isArray(sortBy)) {\n return `${sortBy[0]} ${sortBy[1] ? 'ASC' : 'DESC'}`;\n }\n return `${sortBy} DESC`;\n}\n\nfunction dateToNumber(value?: Date | number): number | undefined {\n return value instanceof Date ? value.getTime() : value;\n}\n\n// @needsAudit\n/**\n * Possible media types.\n */\nexport const MediaType: MediaTypeObject = MediaLibrary.MediaType;\n\n// @needsAudit\n/**\n * Supported keys that can be used to sort `getAssetsAsync` results.\n */\nexport const SortBy: SortByObject = MediaLibrary.SortBy;\n\n// @needsAudit\n/**\n * Returns whether the Media Library API is enabled on the current device.\n * @return A promise which fulfils with a `boolean`, indicating whether the Media Library API is\n * available on the current device.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n return !!MediaLibrary && 'getAssetsAsync' in MediaLibrary;\n}\n\n// @needsAudit @docsMissing\n/**\n * Asks the user to grant permissions for accessing media in user's media library.\n * @param writeOnly\n * @param granularPermissions - A list of [`GranularPermission`](#granularpermission) values. This parameter has an\n * effect only on Android 13 and newer. By default, `expo-media-library` will ask for all possible permissions.\n *\n * > When using granular permissions with a custom config plugin configuration, make sure that all the requested permissions are included in the plugin.\n * @return A promise that fulfils with [`PermissionResponse`](#permissionresponse) object.\n */\nexport async function requestPermissionsAsync(\n writeOnly: boolean = false,\n granularPermissions?: GranularPermission[]\n): Promise<PermissionResponse> {\n if (!MediaLibrary.requestPermissionsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'requestPermissionsAsync');\n }\n if (Platform.OS === 'android') {\n return await MediaLibrary.requestPermissionsAsync(writeOnly, granularPermissions);\n }\n return await MediaLibrary.requestPermissionsAsync(writeOnly);\n}\n\n// @needsAudit @docsMissing\n/**\n * Checks user's permissions for accessing media library.\n * @param writeOnly\n * @param granularPermissions - A list of [`GranularPermission`](#granularpermission) values. This parameter has\n * an effect only on Android 13 and newer. By default, `expo-media-library` will ask for all possible permissions.\n * @return A promise that fulfils with [`PermissionResponse`](#permissionresponse) object.\n */\nexport async function getPermissionsAsync(\n writeOnly: boolean = false,\n granularPermissions?: GranularPermission[]\n): Promise<PermissionResponse> {\n if (!MediaLibrary.getPermissionsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getPermissionsAsync');\n }\n if (Platform.OS === 'android') {\n return await MediaLibrary.getPermissionsAsync(writeOnly, granularPermissions);\n }\n return await MediaLibrary.getPermissionsAsync(writeOnly);\n}\n\n// @needsAudit\n/**\n * Check or request permissions to access the media library.\n * This uses both `requestPermissionsAsync` and `getPermissionsAsync` to interact with the permissions.\n *\n * @example\n * ```ts\n * const [permissionResponse, requestPermission] = MediaLibrary.usePermissions();\n * ```\n */\nexport const usePermissions = createPermissionHook<\n PermissionResponse,\n { writeOnly?: boolean; granularPermissions?: GranularPermission[] }\n>({\n // TODO(cedric): permission requesters should have an options param or a different requester\n getMethod: (options) => getPermissionsAsync(options?.writeOnly, options?.granularPermissions),\n requestMethod: (options) =>\n requestPermissionsAsync(options?.writeOnly, options?.granularPermissions),\n});\n\n// @needsAudit\n/**\n * Allows the user to update the assets that your app has access to.\n * The system modal is only displayed if the user originally allowed only `limited` access to their\n * media library, otherwise this method is a no-op.\n * @param mediaTypes Limits the type(s) of media that the user will be granting access to. By default, a list that shows both photos and videos is presented.\n *\n * @return A promise that either rejects if the method is unavailable, or resolves to `void`.\n * > __Note:__ This method doesn't inform you if the user changes which assets your app has access to.\n * That information is only exposed by iOS, and to obtain it, you need to subscribe for updates to the user's media library using [`addListener()`](#medialibraryaddlistenerlistener).\n * If `hasIncrementalChanges` is `false`, the user changed their permissions.\n *\n * @platform android 14+\n * @platform ios\n */\nexport async function presentPermissionsPickerAsync(\n mediaTypes: MediaTypeFilter[] = ['photo', 'video']\n): Promise<void> {\n if (Platform.OS === 'android' && isExpoGo) {\n throw new UnavailabilityError(\n 'MediaLibrary',\n 'presentPermissionsPickerAsync is unavailable in Expo Go'\n );\n }\n if (Platform.OS === 'android' && Platform.Version >= 34) {\n await MediaLibrary.requestPermissionsAsync(false, mediaTypes);\n return;\n }\n if (!MediaLibrary.presentPermissionsPickerAsync) {\n throw new UnavailabilityError('MediaLibrary', 'presentPermissionsPickerAsync');\n }\n return await MediaLibrary.presentPermissionsPickerAsync();\n}\n\n// @needsAudit\n/**\n * Creates an asset from existing file. The most common use case is to save a picture taken by [Camera](./camera).\n * This method requires `CAMERA_ROLL` permission.\n *\n * @example\n * ```js\n * const { uri } = await Camera.takePictureAsync();\n * const asset = await MediaLibrary.createAssetAsync(uri);\n * ```\n * @param localUri A URI to the image or video file. It must contain an extension. On Android it\n * must be a local path, so it must start with `file:///`\n *\n * @param album An [Album](#album) or its ID. If provided, the asset will be added to this album upon creation, otherwise it will be added to the default album for the media type.\n * The album has exist.\n * @return A promise which fulfils with an object representing an [`Asset`](#asset).\n */\nexport async function createAssetAsync(localUri: string, album?: AlbumRef): Promise<Asset> {\n if (!MediaLibrary.createAssetAsync) {\n throw new UnavailabilityError('MediaLibrary', 'createAssetAsync');\n }\n\n const albumId = getId(album);\n\n if (!localUri || typeof localUri !== 'string') {\n throw new Error('Invalid argument \"localUri\". It must be a string!');\n }\n const asset = await MediaLibrary.createAssetAsync(localUri, albumId);\n\n if (Array.isArray(asset)) {\n // Android returns an array with asset, we need to pick the first item\n return asset[0];\n }\n return asset;\n}\n\n// @needsAudit\n/**\n * Saves the file at given `localUri` to the user's media library. Unlike [`createAssetAsync()`](#medialibrarycreateassetasynclocaluri),\n * This method doesn't return created asset.\n * On __iOS 11+__, it's possible to use this method without asking for `CAMERA_ROLL` permission,\n * however then yours `Info.plist` should have `NSPhotoLibraryAddUsageDescription` key.\n * @param localUri A URI to the image or video file. It must contain an extension. On Android it\n * must be a local path, so it must start with `file:///`.\n */\nexport async function saveToLibraryAsync(localUri: string): Promise<void> {\n if (!MediaLibrary.saveToLibraryAsync) {\n throw new UnavailabilityError('MediaLibrary', 'saveToLibraryAsync');\n }\n return await MediaLibrary.saveToLibraryAsync(localUri);\n}\n\n// @needsAudit\n/**\n * Adds array of assets to the album.\n *\n * On Android, by default it copies assets from the current album to provided one, however it's also\n * possible to move them by passing `false` as `copyAssets` argument. In case they're copied you\n * should keep in mind that `getAssetsAsync` will return duplicated assets.\n * @param assets An array of [Asset](#asset) or their IDs.\n * @param album An [Album](#album) or its ID.\n * @param copy __Android only.__ Whether to copy assets to the new album instead of move them.\n * Defaults to `true`.\n * @return Returns promise which fulfils with `true` if the assets were successfully added to\n * the album.\n */\nexport async function addAssetsToAlbumAsync(\n assets: AssetRef[] | AssetRef,\n album: AlbumRef,\n copy: boolean = true\n): Promise<boolean> {\n if (!MediaLibrary.addAssetsToAlbumAsync) {\n throw new UnavailabilityError('MediaLibrary', 'addAssetsToAlbumAsync');\n }\n\n const assetIds = arrayize(assets).map(getId);\n const albumId = getId(album);\n\n checkAssetIds(assetIds);\n\n if (!albumId || typeof albumId !== 'string') {\n throw new Error('Invalid album ID. It must be a string!');\n }\n\n if (Platform.OS === 'ios') {\n return await MediaLibrary.addAssetsToAlbumAsync(assetIds, albumId);\n }\n return await MediaLibrary.addAssetsToAlbumAsync(assetIds, albumId, !!copy);\n}\n\n// @needsAudit\n/**\n * Removes given assets from album.\n *\n * On Android, album will be automatically deleted if there are no more assets inside.\n * @param assets An array of [Asset](#asset) or their IDs.\n * @param album An [Album](#album) or its ID.\n * @return Returns promise which fulfils with `true` if the assets were successfully removed from\n * the album.\n */\nexport async function removeAssetsFromAlbumAsync(\n assets: AssetRef[] | AssetRef,\n album: AlbumRef\n): Promise<boolean> {\n if (!MediaLibrary.removeAssetsFromAlbumAsync) {\n throw new UnavailabilityError('MediaLibrary', 'removeAssetsFromAlbumAsync');\n }\n\n const assetIds = arrayize(assets).map(getId);\n const albumId = getId(album);\n\n checkAssetIds(assetIds);\n return await MediaLibrary.removeAssetsFromAlbumAsync(assetIds, albumId);\n}\n\n// @needsAudit\n/**\n * Deletes assets from the library. On iOS it deletes assets from all albums they belong to, while\n * on Android it keeps all copies of them (album is strictly connected to the asset). Also, there is\n * additional dialog on iOS that requires user to confirm this action.\n * @param assets An array of [Asset](#asset) or their IDs.\n * @return Returns promise which fulfils with `true` if the assets were successfully deleted.\n */\nexport async function deleteAssetsAsync(assets: AssetRef[] | AssetRef): Promise<boolean> {\n if (!MediaLibrary.deleteAssetsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'deleteAssetsAsync');\n }\n\n const assetIds = arrayize(assets).map(getId);\n\n checkAssetIds(assetIds);\n return await MediaLibrary.deleteAssetsAsync(assetIds);\n}\n\n// @needsAudit\n/**\n * Provides more information about an asset, including GPS location, local URI and EXIF metadata.\n * @param asset An [Asset](#asset) or its ID.\n * @param options\n * @return An [AssetInfo](#assetinfo) object, which is an `Asset` extended by an additional fields.\n */\nexport async function getAssetInfoAsync(\n asset: AssetRef,\n options: MediaLibraryAssetInfoQueryOptions = { shouldDownloadFromNetwork: true }\n): Promise<AssetInfo> {\n if (!MediaLibrary.getAssetInfoAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getAssetInfoAsync');\n }\n\n const assetId = getId(asset);\n\n checkAssetIds([assetId]);\n\n const assetInfo = await MediaLibrary.getAssetInfoAsync(assetId, options);\n\n if (Array.isArray(assetInfo)) {\n // Android returns an array with asset info, we need to pick the first item\n return assetInfo[0];\n }\n return assetInfo;\n}\n\n// @needsAudit\n/**\n * Queries for user-created albums in media gallery.\n * @return A promise which fulfils with an array of [`Album`](#asset)s. Depending on Android version,\n * root directory of your storage may be listed as album titled `\"0\"` or unlisted at all.\n */\nexport async function getAlbumsAsync({ includeSmartAlbums = false }: AlbumsOptions = {}): Promise<\n Album[]\n> {\n if (!MediaLibrary.getAlbumsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getAlbumsAsync');\n }\n return await MediaLibrary.getAlbumsAsync({ includeSmartAlbums });\n}\n\n// @needsAudit\n/**\n * Queries for an album with a specific name.\n * @param title Name of the album to look for.\n * @return An object representing an [`Album`](#album), if album with given name exists, otherwise\n * returns `null`.\n */\nexport async function getAlbumAsync(title: string): Promise<Album> {\n if (!MediaLibrary.getAlbumAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getAlbumAsync');\n }\n if (typeof title !== 'string') {\n throw new Error('Album title must be a string!');\n }\n return await MediaLibrary.getAlbumAsync(title);\n}\n\n// @needsAudit\n/**\n * Creates an album with given name and initial asset. The asset parameter is required on Android,\n * since it's not possible to create empty album on this platform. On Android, by default it copies\n * given asset from the current album to the new one, however it's also possible to move it by\n * passing `false` as `copyAsset` argument.\n * In case it's copied you should keep in mind that `getAssetsAsync` will return duplicated asset.\n * > On Android, it's not possible to create an empty album. You must provide an existing asset to copy or move into the album or an uri of a local file, which will be used to create an initial asset for the album.\n * @param albumName Name of the album to create.\n * @param asset An [Asset](#asset) or its ID. On Android you either need to provide an asset or a localUri.\n * @param initialAssetLocalUri A URI to the local media file, which will be used to create the initial asset inside the album. It must contain an extension. On Android it\n * must be a local path, so it must start with `file:///`. If the `asset` was provided, this parameter will be ignored.\n * @param copyAsset __Android Only.__ Whether to copy asset to the new album instead of move it. This parameter is ignored if `asset` was not provided.\n * Defaults to `true`.\n * @return Newly created [`Album`](#album).\n */\nexport async function createAlbumAsync(\n albumName: string,\n asset?: AssetRef,\n copyAsset: boolean = true,\n initialAssetLocalUri?: string\n): Promise<Album> {\n if (!MediaLibrary.createAlbumAsync) {\n throw new UnavailabilityError('MediaLibrary', 'createAlbumAsync');\n }\n\n const assetId = getId(asset);\n\n if (\n Platform.OS === 'android' &&\n (typeof assetId !== 'string' || assetId.length === 0) &&\n !initialAssetLocalUri\n ) {\n // it's not possible to create empty album on Android, so initial asset must be provided\n throw new Error(\n 'MediaLibrary.createAlbumAsync must be called with an asset or a localUri on Android.'\n );\n }\n if (!albumName || typeof albumName !== 'string') {\n throw new Error('Invalid argument \"albumName\". It must be a string!');\n }\n if (assetId != null && typeof assetId !== 'string') {\n throw new Error('Asset ID must be a string!');\n }\n\n if (Platform.OS === 'ios') {\n return await MediaLibrary.createAlbumAsync(albumName, assetId, initialAssetLocalUri);\n }\n return await MediaLibrary.createAlbumAsync(albumName, assetId, !!copyAsset, initialAssetLocalUri);\n}\n\n// @needsAudit\n/**\n * Deletes given albums from the library. On Android by default it deletes assets belonging to given\n * albums from the library. On iOS it doesn't delete these assets, however it's possible to do by\n * passing `true` as `deleteAssets`.\n * @param albums An array of [`Album`](#asset)s or their IDs.\n * @param assetRemove __iOS Only.__ Whether to also delete assets belonging to given albums.\n * Defaults to `false`.\n * @return Returns a promise which fulfils with `true` if the albums were successfully deleted from\n * the library.\n */\nexport async function deleteAlbumsAsync(\n albums: AlbumRef[] | AlbumRef,\n assetRemove: boolean = false\n): Promise<boolean> {\n if (!MediaLibrary.deleteAlbumsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'deleteAlbumsAsync');\n }\n\n const albumIds = arrayize(albums).map(getId);\n\n checkAlbumIds(albumIds);\n if (Platform.OS === 'android') {\n return await MediaLibrary.deleteAlbumsAsync(albumIds);\n }\n return await MediaLibrary.deleteAlbumsAsync(albumIds, !!assetRemove);\n}\n\n// @needsAudit\n/**\n * Fetches a page of assets matching the provided criteria.\n * @param assetsOptions\n * @return A promise that fulfils with to [`PagedInfo`](#pagedinfo) object with array of [`Asset`](#asset)s.\n */\nexport async function getAssetsAsync(assetsOptions: AssetsOptions = {}): Promise<PagedInfo<Asset>> {\n if (!MediaLibrary.getAssetsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getAssetsAsync');\n }\n\n const { first, after, album, sortBy, mediaType, createdAfter, createdBefore } = assetsOptions;\n\n const options = {\n first: first == null ? 20 : first,\n after: getId(after),\n album: getId(album),\n sortBy: arrayize(sortBy),\n mediaType: arrayize(mediaType || [MediaType.photo]),\n createdAfter: dateToNumber(createdAfter),\n createdBefore: dateToNumber(createdBefore),\n };\n\n if (first != null && typeof options.first !== 'number') {\n throw new Error('Option \"first\" must be a number!');\n }\n if (after != null && typeof options.after !== 'string') {\n throw new Error('Option \"after\" must be a string!');\n }\n if (album != null && typeof options.album !== 'string') {\n throw new Error('Option \"album\" must be a string!');\n }\n if (after != null && Platform.OS === 'android' && isNaN(parseInt(getId(after) as string, 10))) {\n throw new Error('Option \"after\" must be a valid ID!');\n }\n if (first != null && first < 0) {\n throw new Error('Option \"first\" must be a positive integer!');\n }\n\n options.mediaType.forEach(checkMediaType);\n // TODO(@kitten): Add expected native types for `MediaLibrary`\n return await MediaLibrary.getAssetsAsync({\n ...options,\n sortBy: options.sortBy.map(sortByOptionToString),\n });\n}\n\n// @needsAudit\n/**\n * Subscribes for updates in user's media library.\n * @param listener A callback that is fired when any assets have been inserted or deleted from the\n * library. On Android it's invoked with an empty object. On iOS, it's invoked with [`MediaLibraryAssetsChangeEvent`](#medialibraryassetschangeevent)\n * object.\n *\n * Additionally, only on iOS, the listener is also invoked when the user changes access to individual assets in the media library\n * using `presentPermissionsPickerAsync()`.\n * @return An [`Subscription`](#subscription) object that you can call `remove()` on when you would\n * like to unsubscribe the listener.\n */\nexport function addListener(\n listener: (event: MediaLibraryAssetsChangeEvent) => void\n): EventSubscription {\n return MediaLibrary.addListener(MediaLibrary.CHANGE_LISTENER_NAME, listener);\n}\n\n// @docsMissing\nexport function removeSubscription(subscription: EventSubscription): void {\n subscription.remove();\n}\n\n// @needsAudit\n/**\n * Removes all listeners.\n */\nexport function removeAllListeners(): void {\n MediaLibrary.removeAllListeners(MediaLibrary.CHANGE_LISTENER_NAME);\n}\n\n// @needsAudit\n/**\n * Fetches a list of moments, which is a group of assets taken around the same place\n * and time.\n * @return An array of [albums](#album) whose type is `moment`.\n * @platform ios\n */\nexport async function getMomentsAsync() {\n if (!MediaLibrary.getMomentsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getMomentsAsync');\n }\n\n return await MediaLibrary.getMomentsAsync();\n}\n\n// @needsAudit\n/**\n * Moves album content to the special media directories on **Android R** or **above** if needed.\n * Those new locations are in line with the Android `scoped storage` - so your application won't\n * lose write permission to those directories in the future.\n *\n * This method does nothing if:\n * - app is running on **iOS**, **web** or **Android below R**\n * - app has **write permission** to the album folder\n *\n * The migration is possible when the album contains only compatible files types.\n * For instance, movies and pictures are compatible with each other, but music and pictures are not.\n * If automatic migration isn't possible, the function rejects.\n * In that case, you can use methods from the `expo-file-system` to migrate all your files manually.\n *\n * # Why do you need to migrate files?\n * __Android R__ introduced a lot of changes in the storage system. Now applications can't save\n * anything to the root directory. The only available locations are from the `MediaStore` API.\n * Unfortunately, the media library stored albums in folders for which, because of those changes,\n * the application doesn't have permissions anymore. However, it doesn't mean you need to migrate\n * all your albums. If your application doesn't add assets to albums, you don't have to migrate.\n * Everything will work as it used to. You can read more about scoped storage in [the Android documentation](https://developer.android.com/about/versions/11/privacy/storage).\n *\n * @param album An [Album](#album) or its ID.\n * @return A promise which fulfils to `void`.\n */\nexport async function migrateAlbumIfNeededAsync(album: AlbumRef): Promise<void> {\n if (!MediaLibrary.migrateAlbumIfNeededAsync) {\n return;\n }\n\n return await MediaLibrary.migrateAlbumIfNeededAsync(getId(album));\n}\n\n// @needsAudit\n/**\n * Checks if the album should be migrated to a different location. In other words, it checks if the\n * application has the write permission to the album folder. If not, it returns `true`, otherwise `false`.\n * > Note: For **Android below R**, **web** or **iOS**, this function always returns `false`.\n * @param album An [Album](#album) or its ID.\n * @return Returns a promise which fulfils with `true` if the album should be migrated.\n */\nexport async function albumNeedsMigrationAsync(album: AlbumRef): Promise<boolean> {\n if (!MediaLibrary.albumNeedsMigrationAsync) {\n return false;\n }\n\n return await MediaLibrary.albumNeedsMigrationAsync(getId(album));\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MediaLibrary.js","sourceRoot":"","sources":["../src/MediaLibrary.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAGhB,oBAAoB,EACpB,mBAAmB,GAEpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAE9C,MAAM,QAAQ,GAAG,OAAO,IAAI,KAAK,WAAW,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC;AAEjF,IAAI,mBAAmB,GAAG,KAAK,CAAC;AAEhC,IAAI,QAAQ,IAAI,CAAC,mBAAmB,EAAE,CAAC;IACrC,OAAO,CAAC,IAAI,CACV,wQAAwQ,CACzQ,CAAC;IACF,mBAAmB,GAAG,IAAI,CAAC;AAC7B,CAAC;AA6UD,OAAO,EACL,gBAAgB,GAKjB,CAAC;AAEF,SAAS,QAAQ,CAAI,IAAa;IAChC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI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;;;;;;;GAwBG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,KAAe;IAC7D,IAAI,CAAC,YAAY,CAAC,yBAAyB,EAAE,CAAC;QAC5C,OAAO;IACT,CAAC;IAED,OAAO,MAAM,YAAY,CAAC,yBAAyB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,cAAc;AACd;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,KAAe;IAC5D,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,CAAC;QAC3C,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,MAAM,YAAY,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACnE,CAAC","sourcesContent":["import {\n PermissionResponse as EXPermissionResponse,\n PermissionStatus,\n PermissionExpiration,\n PermissionHookOptions,\n createPermissionHook,\n UnavailabilityError,\n EventSubscription,\n} from 'expo-modules-core';\nimport { Platform } from 'react-native';\n\nimport MediaLibrary from './ExpoMediaLibrary';\n\nconst isExpoGo = typeof expo !== 'undefined' && globalThis.expo?.modules?.ExpoGo;\n\nlet loggedExpoGoWarning = false;\n\nif (isExpoGo && !loggedExpoGoWarning) {\n console.warn(\n 'Due to changes in Androids permission requirements, Expo Go can no longer provide full access to the media library. To test the full functionality of this module, you can create a development build. https://docs.expo.dev/develop/development-builds/create-a-build'\n );\n loggedExpoGoWarning = true;\n}\n\n// @needsAudit\nexport type PermissionResponse = EXPermissionResponse & {\n /**\n * Indicates if your app has access to the whole or only part of the photo library. Possible values are:\n * - `'all'` if the user granted your app access to the whole photo library\n * - `'limited'` if the user granted your app access only to selected photos (only available on Android API 14+ and iOS 14.0+)\n * - `'none'` if user denied or hasn't yet granted the permission\n */\n accessPrivileges?: 'all' | 'limited' | 'none';\n};\n\n/**\n * Determines the type of media that the app will ask the OS to get access to.\n * @platform android 13+\n */\nexport type GranularPermission = 'audio' | 'photo' | 'video';\n\nexport type MediaTypeValue = 'audio' | 'photo' | 'video' | 'unknown' | 'pairedVideo';\n\n/**\n * Represents the possible types of media that the app will ask the OS to get access to when calling [`presentPermissionsPickerAsync()`](#medialibrarypresentpermissionspickerasyncmediatypes).\n * @platform android 14+\n * */\nexport type MediaTypeFilter = 'photo' | 'video';\n\nexport type SortByKey =\n | 'default'\n | 'mediaType'\n | 'width'\n | 'height'\n | 'creationTime'\n | 'modificationTime'\n | 'duration';\nexport type SortByValue = [SortByKey, boolean] | SortByKey;\n\ntype InternalSortByValue = `${SortByKey} ${'ASC' | 'DESC'}`;\n\nexport type MediaTypeObject = {\n audio: 'audio';\n photo: 'photo';\n video: 'video';\n unknown: 'unknown';\n};\n\nexport type SortByObject = {\n default: 'default';\n mediaType: 'mediaType';\n width: 'width';\n height: 'height';\n creationTime: 'creationTime';\n modificationTime: 'modificationTime';\n duration: 'duration';\n};\n\n// @needsAudit\nexport type Asset = {\n /**\n * Internal ID that represents an asset.\n */\n id: string;\n /**\n * Filename of the asset.\n */\n filename: string;\n /**\n * URI that points to the asset. `ph://*` (iOS), `file://*` (Android)\n */\n uri: string;\n /**\n * Media type.\n */\n mediaType: MediaTypeValue;\n /**\n * An array of media subtypes.\n * @platform ios\n */\n mediaSubtypes?: MediaSubtype[];\n /**\n * Width of the image or video.\n */\n width: number;\n /**\n * Height of the image or video.\n */\n height: number;\n /**\n * File creation timestamp.\n */\n creationTime: number;\n /**\n * Last modification timestamp.\n */\n modificationTime: number;\n /**\n * Duration of the video or audio asset in seconds.\n */\n duration: number;\n /**\n * Album ID that the asset belongs to.\n * @platform android\n */\n albumId?: string;\n};\n\n// @needsAudit\nexport type AssetInfo = Asset & {\n /**\n * Local URI for the asset.\n */\n localUri?: string;\n /**\n * GPS location if available.\n */\n location?: Location;\n /**\n * EXIF metadata associated with the image.\n */\n exif?: object;\n /**\n * Whether the asset is marked as favorite.\n * @platform ios\n */\n isFavorite?: boolean;\n /**\n * This field is available only if flag `shouldDownloadFromNetwork` is set to `false`.\n * Whether the asset is stored on the network (iCloud on iOS).\n * @platform ios\n */\n isNetworkAsset?: boolean; //iOS only\n /**\n * Display orientation of the image. Orientation is available only for assets whose\n * `mediaType` is `MediaType.photo`. Value will range from 1 to 8, see [EXIF orientation specification](http://sylvana.net/jpegcrop/exif_orientation.html)\n * for more details.\n * @platform ios\n */\n orientation?: number;\n /**\n * Contains information about the video paired with the image file.\n * This field is available if the `mediaType` is `\"photo\"`, and the `mediaSubtypes` includes `\"livePhoto\"`.\n * @platform ios\n */\n pairedVideoAsset?: Asset | null;\n};\n\n/**\n * Constants identifying specific variations of asset media, such as panorama or screenshot photos,\n * and time-lapse or high-frame-rate video. Maps to [`PHAssetMediaSubtype`](https://developer.apple.com/documentation/photokit/phassetmediasubtype#1603888).\n * @platform ios\n * */\nexport type MediaSubtype =\n | 'depthEffect'\n | 'hdr'\n | 'highFrameRate'\n | 'livePhoto'\n | 'panorama'\n | 'screenshot'\n | 'stream'\n | 'timelapse'\n | 'spatialMedia'\n | 'videoCinematic';\n\n// @needsAudit\nexport type MediaLibraryAssetInfoQueryOptions = {\n /**\n * Whether allow the asset to be downloaded from network. Only available in iOS with iCloud assets.\n * @default true\n */\n shouldDownloadFromNetwork?: boolean;\n};\n\n// @needsAudit\nexport type MediaLibraryAssetsChangeEvent = {\n /**\n * Whether the media library's changes could be described as \"incremental changes\".\n * `true` indicates the changes are described by the `insertedAssets`, `deletedAssets` and\n * `updatedAssets` values. `false` indicates that the scope of changes is too large and you\n * should perform a full assets reload (eg. a user has changed access to individual assets in the\n * media library).\n */\n hasIncrementalChanges: boolean;\n /**\n * Available only if `hasIncrementalChanges` is `true`.\n * Array of [`Asset`](#asset)s that have been inserted to the library.\n */\n insertedAssets?: Asset[];\n /**\n * Available only if `hasIncrementalChanges` is `true`.\n * Array of [`Asset`](#asset)s that have been deleted from the library.\n */\n deletedAssets?: Asset[];\n /**\n * Available only if `hasIncrementalChanges` is `true`.\n * Array of [`Asset`](#asset)s that have been updated or completed downloading from network\n * storage (iCloud on iOS).\n */\n updatedAssets?: Asset[];\n};\n\n// @docsMissing\nexport type Location = {\n latitude: number;\n longitude: number;\n};\n\n// @needsAudit\nexport type Album = {\n /**\n * Album ID.\n */\n id: string;\n /**\n * Album title.\n */\n title: string;\n /**\n * Estimated number of assets in the album.\n */\n assetCount: number;\n /**\n * The type of the assets album.\n * @platform ios\n */\n type?: AlbumType;\n /**\n * Apply only to albums whose type is `'moment'`. Earliest creation timestamp of all\n * assets in the moment.\n * @platform ios\n */\n startTime: number;\n /**\n * Apply only to albums whose type is `'moment'`. Latest creation timestamp of all\n * assets in the moment.\n * @platform ios\n */\n endTime: number;\n /**\n * Apply only to albums whose type is `'moment'`. Approximated location of all\n * assets in the moment.\n * @platform ios\n */\n approximateLocation?: Location;\n /**\n * Apply only to albums whose type is `'moment'`. Names of locations grouped\n * in the moment.\n * @platform ios\n */\n locationNames?: string[];\n};\n\n// @docsMissing\nexport type AlbumType = 'album' | 'moment' | 'smartAlbum';\n\n// @docsMissing\nexport type AlbumsOptions = {\n includeSmartAlbums?: boolean;\n};\n\n// @needsAudit\nexport type AssetsOptions = {\n /**\n * The maximum number of items on a single page.\n * @default 20\n */\n first?: number;\n /**\n * Asset ID of the last item returned on the previous page. To get the ID of the next page,\n * pass [`endCursor`](#pagedinfo) as its value.\n */\n after?: AssetRef;\n /**\n * [Album](#album) or its ID to get assets from specific album.\n */\n album?: AlbumRef;\n /**\n * An array of [`SortByValue`](#sortbyvalue)s or a single `SortByValue` value. By default, all\n * keys are sorted in descending order, however you can also pass a pair `[key, ascending]` where\n * the second item is a `boolean` value that means whether to use ascending order. Note that if\n * the `SortBy.default` key is used, then `ascending` argument will not matter. Earlier items have\n * higher priority when sorting out the results.\n * If empty, this method uses the default sorting that is provided by the platform.\n */\n sortBy?: SortByValue[] | SortByValue;\n /**\n * An array of [MediaTypeValue](#mediatypevalue)s or a single `MediaTypeValue`.\n * @default MediaType.photo\n */\n mediaType?: MediaTypeValue[] | MediaTypeValue;\n /**\n * An array of [MediaSubtype](#mediasubtype)s or a single `MediaSubtype`.\n * @platform ios\n */\n mediaSubtypes?: MediaSubtype[] | MediaSubtype;\n /**\n * `Date` object or Unix timestamp in milliseconds limiting returned assets only to those that\n * were created after this date.\n */\n createdAfter?: Date | number;\n /**\n * Similarly as `createdAfter`, but limits assets only to those that were created before specified\n * date.\n */\n createdBefore?: Date | number;\n};\n\n// @needsAudit\nexport type PagedInfo<T> = {\n /**\n * A page of [`Asset`](#asset)s fetched by the query.\n */\n assets: T[];\n /**\n * ID of the last fetched asset. It should be passed as `after` option in order to get the\n * next page.\n */\n endCursor: string;\n /**\n * Whether there are more assets to fetch.\n */\n hasNextPage: boolean;\n /**\n * Estimated total number of assets that match the query.\n */\n totalCount: number;\n};\n\n// @docsMissing\nexport type AssetRef = Asset | string;\n\n// @docsMissing\nexport type AlbumRef = Album | string;\n\nexport {\n PermissionStatus,\n PermissionExpiration,\n EXPermissionResponse,\n PermissionHookOptions,\n EventSubscription as Subscription,\n};\n\nfunction arrayize<T>(item: T | T[]): T[] {\n if (Array.isArray(item)) {\n return item;\n }\n return item ? [item] : [];\n}\n\nfunction getId(ref: string | undefined | { id?: string }): string | undefined {\n if (typeof ref === 'string') {\n return ref;\n }\n return ref ? ref.id : undefined;\n}\n\nfunction checkAssetIds(assetIds: unknown[]): asserts assetIds is string[] {\n if (assetIds.some((id) => !id || typeof id !== 'string')) {\n throw new Error('Asset ID must be a string!');\n }\n}\n\nfunction checkAlbumIds(albumIds: unknown[]): asserts albumIds is string[] {\n if (albumIds.some((id) => !id || typeof id !== 'string')) {\n throw new Error('Album ID must be a string!');\n }\n}\n\nfunction checkMediaType(mediaType: unknown): asserts mediaType is keyof MediaTypeObject {\n if (Object.values(MediaType).indexOf(mediaType as any) === -1) {\n throw new Error(`Invalid mediaType: ${mediaType}`);\n }\n}\n\nfunction checkSortBy(sortBy: unknown): asserts sortBy is SortByValue {\n if (Array.isArray(sortBy)) {\n checkSortByKey(sortBy[0]);\n\n if (typeof sortBy[1] !== 'boolean') {\n throw new Error('Invalid sortBy array argument. Second item must be a boolean!');\n }\n } else {\n checkSortByKey(sortBy);\n }\n}\n\nfunction checkSortByKey(sortBy: any): void {\n if (Object.values(SortBy).indexOf(sortBy) === -1) {\n throw new Error(`Invalid sortBy key: ${sortBy}`);\n }\n}\n\nfunction sortByOptionToString(sortBy: SortByValue | undefined): InternalSortByValue {\n checkSortBy(sortBy);\n if (Array.isArray(sortBy)) {\n return `${sortBy[0]} ${sortBy[1] ? 'ASC' : 'DESC'}`;\n }\n return `${sortBy} DESC`;\n}\n\nfunction dateToNumber(value?: Date | number): number | undefined {\n return value instanceof Date ? value.getTime() : value;\n}\n\n// @needsAudit\n/**\n * Possible media types.\n */\nexport const MediaType: MediaTypeObject = MediaLibrary.MediaType;\n\n// @needsAudit\n/**\n * Supported keys that can be used to sort `getAssetsAsync` results.\n */\nexport const SortBy: SortByObject = MediaLibrary.SortBy;\n\n// @needsAudit\n/**\n * Returns whether the Media Library API is enabled on the current device.\n * @return A promise which fulfils with a `boolean`, indicating whether the Media Library API is\n * available on the current device.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n return !!MediaLibrary && 'getAssetsAsync' in MediaLibrary;\n}\n\n// @needsAudit @docsMissing\n/**\n * Asks the user to grant permissions for accessing media in user's media library.\n * @param writeOnly\n * @param granularPermissions - A list of [`GranularPermission`](#granularpermission) values. This parameter has an\n * effect only on Android 13 and newer. By default, `expo-media-library` will ask for all possible permissions.\n *\n * > When using granular permissions with a custom config plugin configuration, make sure that all the requested permissions are included in the plugin.\n * @return A promise that fulfils with [`PermissionResponse`](#permissionresponse) object.\n */\nexport async function requestPermissionsAsync(\n writeOnly: boolean = false,\n granularPermissions?: GranularPermission[]\n): Promise<PermissionResponse> {\n if (!MediaLibrary.requestPermissionsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'requestPermissionsAsync');\n }\n if (Platform.OS === 'android') {\n return await MediaLibrary.requestPermissionsAsync(writeOnly, granularPermissions);\n }\n return await MediaLibrary.requestPermissionsAsync(writeOnly);\n}\n\n// @needsAudit @docsMissing\n/**\n * Checks user's permissions for accessing media library.\n * @param writeOnly\n * @param granularPermissions - A list of [`GranularPermission`](#granularpermission) values. This parameter has\n * an effect only on Android 13 and newer. By default, `expo-media-library` will ask for all possible permissions.\n * @return A promise that fulfils with [`PermissionResponse`](#permissionresponse) object.\n */\nexport async function getPermissionsAsync(\n writeOnly: boolean = false,\n granularPermissions?: GranularPermission[]\n): Promise<PermissionResponse> {\n if (!MediaLibrary.getPermissionsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getPermissionsAsync');\n }\n if (Platform.OS === 'android') {\n return await MediaLibrary.getPermissionsAsync(writeOnly, granularPermissions);\n }\n return await MediaLibrary.getPermissionsAsync(writeOnly);\n}\n\n// @needsAudit\n/**\n * Check or request permissions to access the media library.\n * This uses both `requestPermissionsAsync` and `getPermissionsAsync` to interact with the permissions.\n *\n * @example\n * ```ts\n * const [permissionResponse, requestPermission] = MediaLibrary.usePermissions();\n * ```\n */\nexport const usePermissions = createPermissionHook<\n PermissionResponse,\n { writeOnly?: boolean; granularPermissions?: GranularPermission[] }\n>({\n // TODO(cedric): permission requesters should have an options param or a different requester\n getMethod: (options) => getPermissionsAsync(options?.writeOnly, options?.granularPermissions),\n requestMethod: (options) =>\n requestPermissionsAsync(options?.writeOnly, options?.granularPermissions),\n});\n\n// @needsAudit\n/**\n * Allows the user to update the assets that your app has access to.\n * The system modal is only displayed if the user originally allowed only `limited` access to their\n * media library, otherwise this method is a no-op.\n * @param mediaTypes Limits the type(s) of media that the user will be granting access to. By default, a list that shows both photos and videos is presented.\n *\n * @return A promise that either rejects if the method is unavailable, or resolves to `void`.\n * > __Note:__ This method doesn't inform you if the user changes which assets your app has access to.\n * That information is only exposed by iOS, and to obtain it, you need to subscribe for updates to the user's media library using [`addListener()`](#medialibraryaddlistenerlistener).\n * If `hasIncrementalChanges` is `false`, the user changed their permissions.\n *\n * @platform android 14+\n * @platform ios\n */\nexport async function presentPermissionsPickerAsync(\n mediaTypes: MediaTypeFilter[] = ['photo', 'video']\n): Promise<void> {\n if (Platform.OS === 'android' && isExpoGo) {\n throw new UnavailabilityError(\n 'MediaLibrary',\n 'presentPermissionsPickerAsync is unavailable in Expo Go'\n );\n }\n if (Platform.OS === 'android' && Platform.Version >= 34) {\n await MediaLibrary.requestPermissionsAsync(false, mediaTypes);\n return;\n }\n if (!MediaLibrary.presentPermissionsPickerAsync) {\n throw new UnavailabilityError('MediaLibrary', 'presentPermissionsPickerAsync');\n }\n return await MediaLibrary.presentPermissionsPickerAsync();\n}\n\n// @needsAudit\n/**\n * Creates an asset from existing file. The most common use case is to save a picture taken by [Camera](./camera).\n * This method requires `CAMERA_ROLL` permission.\n *\n * @example\n * ```js\n * const { uri } = await Camera.takePictureAsync();\n * const asset = await MediaLibrary.createAssetAsync(uri);\n * ```\n * @param localUri A URI to the image or video file. It must contain an extension. On Android it\n * must be a local path, so it must start with `file:///`\n *\n * @param album An [Album](#album) or its ID. If provided, the asset will be added to this album upon creation, otherwise it will be added to the default album for the media type.\n * The album has exist.\n * @return A promise which fulfils with an object representing an [`Asset`](#asset).\n */\nexport async function createAssetAsync(localUri: string, album?: AlbumRef): Promise<Asset> {\n if (!MediaLibrary.createAssetAsync) {\n throw new UnavailabilityError('MediaLibrary', 'createAssetAsync');\n }\n\n const albumId = getId(album);\n\n if (!localUri || typeof localUri !== 'string') {\n throw new Error('Invalid argument \"localUri\". It must be a string!');\n }\n const asset = await MediaLibrary.createAssetAsync(localUri, albumId);\n\n if (Array.isArray(asset)) {\n // Android returns an array with asset, we need to pick the first item\n return asset[0];\n }\n return asset;\n}\n\n// @needsAudit\n/**\n * Saves the file at given `localUri` to the user's media library. Unlike [`createAssetAsync()`](#medialibrarycreateassetasynclocaluri),\n * This method doesn't return created asset.\n * On __iOS 11+__, it's possible to use this method without asking for `CAMERA_ROLL` permission,\n * however then yours `Info.plist` should have `NSPhotoLibraryAddUsageDescription` key.\n * @param localUri A URI to the image or video file. It must contain an extension. On Android it\n * must be a local path, so it must start with `file:///`.\n */\nexport async function saveToLibraryAsync(localUri: string): Promise<void> {\n if (!MediaLibrary.saveToLibraryAsync) {\n throw new UnavailabilityError('MediaLibrary', 'saveToLibraryAsync');\n }\n return await MediaLibrary.saveToLibraryAsync(localUri);\n}\n\n// @needsAudit\n/**\n * Adds array of assets to the album.\n *\n * On Android, by default it copies assets from the current album to provided one, however it's also\n * possible to move them by passing `false` as `copyAssets` argument. In case they're copied you\n * should keep in mind that `getAssetsAsync` will return duplicated assets.\n * @param assets An array of [Asset](#asset) or their IDs.\n * @param album An [Album](#album) or its ID.\n * @param copy __Android only.__ Whether to copy assets to the new album instead of move them.\n * Defaults to `true`.\n * @return Returns promise which fulfils with `true` if the assets were successfully added to\n * the album.\n */\nexport async function addAssetsToAlbumAsync(\n assets: AssetRef[] | AssetRef,\n album: AlbumRef,\n copy: boolean = true\n): Promise<boolean> {\n if (!MediaLibrary.addAssetsToAlbumAsync) {\n throw new UnavailabilityError('MediaLibrary', 'addAssetsToAlbumAsync');\n }\n\n const assetIds = arrayize(assets).map(getId);\n const albumId = getId(album);\n\n checkAssetIds(assetIds);\n\n if (!albumId || typeof albumId !== 'string') {\n throw new Error('Invalid album ID. It must be a string!');\n }\n\n if (Platform.OS === 'ios') {\n return await MediaLibrary.addAssetsToAlbumAsync(assetIds, albumId);\n }\n return await MediaLibrary.addAssetsToAlbumAsync(assetIds, albumId, !!copy);\n}\n\n// @needsAudit\n/**\n * Removes given assets from album.\n *\n * On Android, album will be automatically deleted if there are no more assets inside.\n * @param assets An array of [Asset](#asset) or their IDs.\n * @param album An [Album](#album) or its ID.\n * @return Returns promise which fulfils with `true` if the assets were successfully removed from\n * the album.\n */\nexport async function removeAssetsFromAlbumAsync(\n assets: AssetRef[] | AssetRef,\n album: AlbumRef\n): Promise<boolean> {\n if (!MediaLibrary.removeAssetsFromAlbumAsync) {\n throw new UnavailabilityError('MediaLibrary', 'removeAssetsFromAlbumAsync');\n }\n\n const assetIds = arrayize(assets).map(getId);\n const albumId = getId(album);\n\n checkAssetIds(assetIds);\n return await MediaLibrary.removeAssetsFromAlbumAsync(assetIds, albumId);\n}\n\n// @needsAudit\n/**\n * Deletes assets from the library. On iOS it deletes assets from all albums they belong to, while\n * on Android it keeps all copies of them (album is strictly connected to the asset). Also, there is\n * additional dialog on iOS that requires user to confirm this action.\n * @param assets An array of [Asset](#asset) or their IDs.\n * @return Returns promise which fulfils with `true` if the assets were successfully deleted.\n */\nexport async function deleteAssetsAsync(assets: AssetRef[] | AssetRef): Promise<boolean> {\n if (!MediaLibrary.deleteAssetsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'deleteAssetsAsync');\n }\n\n const assetIds = arrayize(assets).map(getId);\n\n checkAssetIds(assetIds);\n return await MediaLibrary.deleteAssetsAsync(assetIds);\n}\n\n// @needsAudit\n/**\n * Provides more information about an asset, including GPS location, local URI and EXIF metadata.\n * @param asset An [Asset](#asset) or its ID.\n * @param options\n * @return An [AssetInfo](#assetinfo) object, which is an `Asset` extended by an additional fields.\n */\nexport async function getAssetInfoAsync(\n asset: AssetRef,\n options: MediaLibraryAssetInfoQueryOptions = { shouldDownloadFromNetwork: true }\n): Promise<AssetInfo> {\n if (!MediaLibrary.getAssetInfoAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getAssetInfoAsync');\n }\n\n const assetId = getId(asset);\n\n checkAssetIds([assetId]);\n\n const assetInfo = await MediaLibrary.getAssetInfoAsync(assetId, options);\n\n if (Array.isArray(assetInfo)) {\n // Android returns an array with asset info, we need to pick the first item\n return assetInfo[0];\n }\n return assetInfo;\n}\n\n// @needsAudit\n/**\n * Queries for user-created albums in media gallery.\n * @return A promise which fulfils with an array of [`Album`](#asset)s. Depending on Android version,\n * root directory of your storage may be listed as album titled `\"0\"` or unlisted at all.\n */\nexport async function getAlbumsAsync({ includeSmartAlbums = false }: AlbumsOptions = {}): Promise<\n Album[]\n> {\n if (!MediaLibrary.getAlbumsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getAlbumsAsync');\n }\n return await MediaLibrary.getAlbumsAsync({ includeSmartAlbums });\n}\n\n// @needsAudit\n/**\n * Queries for an album with a specific name.\n * @param title Name of the album to look for.\n * @return An object representing an [`Album`](#album), if album with given name exists, otherwise\n * returns `null`.\n */\nexport async function getAlbumAsync(title: string): Promise<Album> {\n if (!MediaLibrary.getAlbumAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getAlbumAsync');\n }\n if (typeof title !== 'string') {\n throw new Error('Album title must be a string!');\n }\n return await MediaLibrary.getAlbumAsync(title);\n}\n\n// @needsAudit\n/**\n * Creates an album with given name and initial asset. The asset parameter is required on Android,\n * since it's not possible to create empty album on this platform. On Android, by default it copies\n * given asset from the current album to the new one, however it's also possible to move it by\n * passing `false` as `copyAsset` argument.\n * In case it's copied you should keep in mind that `getAssetsAsync` will return duplicated asset.\n * > On Android, it's not possible to create an empty album. You must provide an existing asset to copy or move into the album or an uri of a local file, which will be used to create an initial asset for the album.\n * @param albumName Name of the album to create.\n * @param asset An [Asset](#asset) or its ID. On Android you either need to provide an asset or a localUri.\n * @param initialAssetLocalUri A URI to the local media file, which will be used to create the initial asset inside the album. It must contain an extension. On Android it\n * must be a local path, so it must start with `file:///`. If the `asset` was provided, this parameter will be ignored.\n * @param copyAsset __Android Only.__ Whether to copy asset to the new album instead of move it. This parameter is ignored if `asset` was not provided.\n * Defaults to `true`.\n * @return Newly created [`Album`](#album).\n */\nexport async function createAlbumAsync(\n albumName: string,\n asset?: AssetRef,\n copyAsset: boolean = true,\n initialAssetLocalUri?: string\n): Promise<Album> {\n if (!MediaLibrary.createAlbumAsync) {\n throw new UnavailabilityError('MediaLibrary', 'createAlbumAsync');\n }\n\n const assetId = getId(asset);\n\n if (\n Platform.OS === 'android' &&\n (typeof assetId !== 'string' || assetId.length === 0) &&\n !initialAssetLocalUri\n ) {\n // it's not possible to create empty album on Android, so initial asset must be provided\n throw new Error(\n 'MediaLibrary.createAlbumAsync must be called with an asset or a localUri on Android.'\n );\n }\n if (!albumName || typeof albumName !== 'string') {\n throw new Error('Invalid argument \"albumName\". It must be a string!');\n }\n if (assetId != null && typeof assetId !== 'string') {\n throw new Error('Asset ID must be a string!');\n }\n\n if (Platform.OS === 'ios') {\n return await MediaLibrary.createAlbumAsync(albumName, assetId, initialAssetLocalUri);\n }\n return await MediaLibrary.createAlbumAsync(albumName, assetId, !!copyAsset, initialAssetLocalUri);\n}\n\n// @needsAudit\n/**\n * Deletes given albums from the library. On Android by default it deletes assets belonging to given\n * albums from the library. On iOS it doesn't delete these assets, however it's possible to do by\n * passing `true` as `deleteAssets`.\n * @param albums An array of [`Album`](#asset)s or their IDs.\n * @param assetRemove __iOS Only.__ Whether to also delete assets belonging to given albums.\n * Defaults to `false`.\n * @return Returns a promise which fulfils with `true` if the albums were successfully deleted from\n * the library.\n */\nexport async function deleteAlbumsAsync(\n albums: AlbumRef[] | AlbumRef,\n assetRemove: boolean = false\n): Promise<boolean> {\n if (!MediaLibrary.deleteAlbumsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'deleteAlbumsAsync');\n }\n\n const albumIds = arrayize(albums).map(getId);\n\n checkAlbumIds(albumIds);\n if (Platform.OS === 'android') {\n return await MediaLibrary.deleteAlbumsAsync(albumIds);\n }\n return await MediaLibrary.deleteAlbumsAsync(albumIds, !!assetRemove);\n}\n\n// @needsAudit\n/**\n * Fetches a page of assets matching the provided criteria.\n * @param assetsOptions\n * @return A promise that fulfils with to [`PagedInfo`](#pagedinfo) object with array of [`Asset`](#asset)s.\n */\nexport async function getAssetsAsync(assetsOptions: AssetsOptions = {}): Promise<PagedInfo<Asset>> {\n if (!MediaLibrary.getAssetsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getAssetsAsync');\n }\n\n const { first, after, album, sortBy, mediaType, createdAfter, createdBefore, mediaSubtypes } =\n assetsOptions;\n\n const options = {\n first: first == null ? 20 : first,\n after: getId(after),\n album: getId(album),\n sortBy: arrayize(sortBy),\n mediaType: arrayize(mediaType || [MediaType.photo]),\n mediaSubtypes: arrayize(mediaSubtypes),\n createdAfter: dateToNumber(createdAfter),\n createdBefore: dateToNumber(createdBefore),\n };\n\n if (first != null && typeof options.first !== 'number') {\n throw new Error('Option \"first\" must be a number!');\n }\n if (after != null && typeof options.after !== 'string') {\n throw new Error('Option \"after\" must be a string!');\n }\n if (album != null && typeof options.album !== 'string') {\n throw new Error('Option \"album\" must be a string!');\n }\n if (after != null && Platform.OS === 'android' && isNaN(parseInt(getId(after) as string, 10))) {\n throw new Error('Option \"after\" must be a valid ID!');\n }\n if (first != null && first < 0) {\n throw new Error('Option \"first\" must be a positive integer!');\n }\n\n options.mediaType.forEach(checkMediaType);\n // TODO(@kitten): Add expected native types for `MediaLibrary`\n return await MediaLibrary.getAssetsAsync({\n ...options,\n sortBy: options.sortBy.map(sortByOptionToString),\n });\n}\n\n// @needsAudit\n/**\n * Subscribes for updates in user's media library.\n * @param listener A callback that is fired when any assets have been inserted or deleted from the\n * library. On Android it's invoked with an empty object. On iOS, it's invoked with [`MediaLibraryAssetsChangeEvent`](#medialibraryassetschangeevent)\n * object.\n *\n * Additionally, only on iOS, the listener is also invoked when the user changes access to individual assets in the media library\n * using `presentPermissionsPickerAsync()`.\n * @return An [`Subscription`](#subscription) object that you can call `remove()` on when you would\n * like to unsubscribe the listener.\n */\nexport function addListener(\n listener: (event: MediaLibraryAssetsChangeEvent) => void\n): EventSubscription {\n return MediaLibrary.addListener(MediaLibrary.CHANGE_LISTENER_NAME, listener);\n}\n\n// @docsMissing\nexport function removeSubscription(subscription: EventSubscription): void {\n subscription.remove();\n}\n\n// @needsAudit\n/**\n * Removes all listeners.\n */\nexport function removeAllListeners(): void {\n MediaLibrary.removeAllListeners(MediaLibrary.CHANGE_LISTENER_NAME);\n}\n\n// @needsAudit\n/**\n * Fetches a list of moments, which is a group of assets taken around the same place\n * and time.\n * @return An array of [albums](#album) whose type is `moment`.\n * @platform ios\n */\nexport async function getMomentsAsync() {\n if (!MediaLibrary.getMomentsAsync) {\n throw new UnavailabilityError('MediaLibrary', 'getMomentsAsync');\n }\n\n return await MediaLibrary.getMomentsAsync();\n}\n\n// @needsAudit\n/**\n * Moves album content to the special media directories on **Android R** or **above** if needed.\n * Those new locations are in line with the Android `scoped storage` - so your application won't\n * lose write permission to those directories in the future.\n *\n * This method does nothing if:\n * - app is running on **iOS**, **web** or **Android below R**\n * - app has **write permission** to the album folder\n *\n * The migration is possible when the album contains only compatible files types.\n * For instance, movies and pictures are compatible with each other, but music and pictures are not.\n * If automatic migration isn't possible, the function rejects.\n * In that case, you can use methods from the `expo-file-system` to migrate all your files manually.\n *\n * # Why do you need to migrate files?\n * __Android R__ introduced a lot of changes in the storage system. Now applications can't save\n * anything to the root directory. The only available locations are from the `MediaStore` API.\n * Unfortunately, the media library stored albums in folders for which, because of those changes,\n * the application doesn't have permissions anymore. However, it doesn't mean you need to migrate\n * all your albums. If your application doesn't add assets to albums, you don't have to migrate.\n * Everything will work as it used to. You can read more about scoped storage in [the Android documentation](https://developer.android.com/about/versions/11/privacy/storage).\n *\n * @param album An [Album](#album) or its ID.\n * @return A promise which fulfils to `void`.\n */\nexport async function migrateAlbumIfNeededAsync(album: AlbumRef): Promise<void> {\n if (!MediaLibrary.migrateAlbumIfNeededAsync) {\n return;\n }\n\n return await MediaLibrary.migrateAlbumIfNeededAsync(getId(album));\n}\n\n// @needsAudit\n/**\n * Checks if the album should be migrated to a different location. In other words, it checks if the\n * application has the write permission to the album folder. If not, it returns `true`, otherwise `false`.\n * > Note: For **Android below R**, **web** or **iOS**, this function always returns `false`.\n * @param album An [Album](#album) or its ID.\n * @return Returns a promise which fulfils with `true` if the album should be migrated.\n */\nexport async function albumNeedsMigrationAsync(album: AlbumRef): Promise<boolean> {\n if (!MediaLibrary.albumNeedsMigrationAsync) {\n return false;\n }\n\n return await MediaLibrary.albumNeedsMigrationAsync(getId(album));\n}\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -8,16 +8,76 @@ enum MediaType: String, Enumerable {
|
|
|
8
8
|
case all
|
|
9
9
|
case unknown
|
|
10
10
|
|
|
11
|
+
init(fromPHAssetMediaType mediaType: PHAssetMediaType) {
|
|
12
|
+
let result: MediaType = switch mediaType {
|
|
13
|
+
case .audio: .audio
|
|
14
|
+
case .image: .photo
|
|
15
|
+
case .video: .video
|
|
16
|
+
default: .unknown
|
|
17
|
+
}
|
|
18
|
+
self = result
|
|
19
|
+
}
|
|
20
|
+
|
|
11
21
|
func toPHMediaType() -> PHAssetMediaType {
|
|
12
22
|
switch self {
|
|
13
|
-
case .audio:
|
|
14
|
-
|
|
15
|
-
case .
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
case .audio: .audio
|
|
24
|
+
case .photo: .image
|
|
25
|
+
case .video: .video
|
|
26
|
+
default: .unknown
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
enum MediaSubtype: String, Enumerable {
|
|
32
|
+
case depthEffect
|
|
33
|
+
case hdr
|
|
34
|
+
case highFrameRate
|
|
35
|
+
case livePhoto
|
|
36
|
+
case panorama
|
|
37
|
+
case screenshot
|
|
38
|
+
case stream
|
|
39
|
+
case timelapse
|
|
40
|
+
case spatialMedia
|
|
41
|
+
case videoCinematic
|
|
42
|
+
|
|
43
|
+
static func stringify(_ mediaSubtypes: PHAssetMediaSubtype) -> [MediaSubtype.RawValue] {
|
|
44
|
+
var mapping: [(PHAssetMediaSubtype, MediaSubtype)] = [
|
|
45
|
+
(.photoDepthEffect, .depthEffect),
|
|
46
|
+
(.photoHDR, .hdr),
|
|
47
|
+
(.videoHighFrameRate, .highFrameRate),
|
|
48
|
+
(.photoLive, .livePhoto),
|
|
49
|
+
(.photoPanorama, .panorama),
|
|
50
|
+
(.photoScreenshot, .screenshot),
|
|
51
|
+
(.videoStreamed, .stream),
|
|
52
|
+
(.videoTimelapse, .timelapse),
|
|
53
|
+
(.videoCinematic, .videoCinematic)
|
|
54
|
+
]
|
|
55
|
+
if #available(iOS 16.0, *) {
|
|
56
|
+
mapping.append((.spatialMedia, .spatialMedia))
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return mapping.compactMap { phSubtype, mediaSubtype in
|
|
60
|
+
mediaSubtypes.contains(phSubtype) ? mediaSubtype.rawValue : nil
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
func toPHAssetMediaSubtype() -> PHAssetMediaSubtype {
|
|
65
|
+
switch self {
|
|
66
|
+
case .depthEffect: .photoDepthEffect
|
|
67
|
+
case .hdr: .photoHDR
|
|
68
|
+
case .highFrameRate: .videoHighFrameRate
|
|
69
|
+
case .livePhoto: .photoLive
|
|
70
|
+
case .panorama: .photoPanorama
|
|
71
|
+
case .screenshot: .photoScreenshot
|
|
72
|
+
case .stream: .videoStreamed
|
|
73
|
+
case .timelapse: .videoTimelapse
|
|
74
|
+
case .spatialMedia:
|
|
75
|
+
if #available(iOS 16, *) {
|
|
76
|
+
.spatialMedia
|
|
77
|
+
} else {
|
|
78
|
+
[]
|
|
79
|
+
}
|
|
80
|
+
case .videoCinematic: .videoCinematic
|
|
21
81
|
}
|
|
22
82
|
}
|
|
23
83
|
}
|
|
@@ -36,6 +96,7 @@ struct AssetWithOptions: Record {
|
|
|
36
96
|
@Field var album: String?
|
|
37
97
|
@Field var sortBy: [String] = []
|
|
38
98
|
@Field var mediaType: [MediaType]
|
|
99
|
+
@Field var mediaSubtypes: [MediaSubtype]
|
|
39
100
|
@Field var createdAfter: Double?
|
|
40
101
|
@Field var createdBefore: Double?
|
|
41
102
|
}
|
|
@@ -2,38 +2,6 @@ import ExpoModulesCore
|
|
|
2
2
|
import Photos
|
|
3
3
|
import CoreServices
|
|
4
4
|
|
|
5
|
-
func stringify(mediaType: PHAssetMediaType) -> String {
|
|
6
|
-
switch mediaType {
|
|
7
|
-
case .audio:
|
|
8
|
-
return "audio"
|
|
9
|
-
case .image:
|
|
10
|
-
return "photo"
|
|
11
|
-
case .video:
|
|
12
|
-
return "video"
|
|
13
|
-
default:
|
|
14
|
-
return "unknown"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
func stringifyMedia(mediaSubtypes: PHAssetMediaSubtype) -> [String] {
|
|
19
|
-
let subtypesDict: [String: PHAssetMediaSubtype] = [
|
|
20
|
-
"hdr": .photoHDR,
|
|
21
|
-
"panorama": .photoPanorama,
|
|
22
|
-
"stream": .videoStreamed,
|
|
23
|
-
"timelapse": .videoTimelapse,
|
|
24
|
-
"screenshot": .photoScreenshot,
|
|
25
|
-
"highFrameRate": .videoHighFrameRate,
|
|
26
|
-
"livePhoto": .photoLive,
|
|
27
|
-
"depthEffect": .photoDepthEffect
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
var subtypes = [String]()
|
|
31
|
-
for (subtype, value) in subtypesDict where mediaSubtypes.contains(value) {
|
|
32
|
-
subtypes.append(subtype)
|
|
33
|
-
}
|
|
34
|
-
return subtypes
|
|
35
|
-
}
|
|
36
|
-
|
|
37
5
|
func exportDate(_ date: Date?) -> Double? {
|
|
38
6
|
if let date = date {
|
|
39
7
|
let interval = date.timeIntervalSince1970
|
|
@@ -56,27 +24,22 @@ func stringifyAlbumType(type: PHAssetCollectionType) -> String {
|
|
|
56
24
|
}
|
|
57
25
|
}
|
|
58
26
|
|
|
59
|
-
func exportAssetInfo(asset: PHAsset) -> [String: Any?]
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
return nil
|
|
27
|
+
func exportAssetInfo(asset: PHAsset) -> [String: Any?] {
|
|
28
|
+
var assetDict = exportAsset(asset: asset)
|
|
29
|
+
assetDict["location"] = exportLocation(location: asset.location)
|
|
30
|
+
assetDict["isFavorite"] = asset.isFavorite
|
|
31
|
+
assetDict["isHidden"] = asset.isHidden
|
|
32
|
+
return assetDict
|
|
67
33
|
}
|
|
68
34
|
|
|
69
|
-
func exportAsset(asset: PHAsset
|
|
70
|
-
guard let asset else {
|
|
71
|
-
return nil
|
|
72
|
-
}
|
|
35
|
+
func exportAsset(asset: PHAsset) -> [String: Any?] {
|
|
73
36
|
let fileName = asset.value(forKey: "filename")
|
|
74
37
|
return [
|
|
75
38
|
"id": asset.localIdentifier,
|
|
76
39
|
"filename": fileName,
|
|
77
40
|
"uri": assetUriForLocalId(localId: asset.localIdentifier),
|
|
78
|
-
"mediaType":
|
|
79
|
-
"mediaSubtypes":
|
|
41
|
+
"mediaType": MediaType(fromPHAssetMediaType: asset.mediaType).rawValue,
|
|
42
|
+
"mediaSubtypes": MediaSubtype.stringify(asset.mediaSubtypes),
|
|
80
43
|
"width": asset.pixelWidth,
|
|
81
44
|
"height": asset.pixelHeight,
|
|
82
45
|
// Uses required reason API based on the following reason: 0A2A.1
|
|
@@ -395,6 +358,18 @@ func getAssetsWithAfter(options: AssetWithOptions, collection: PHAssetCollection
|
|
|
395
358
|
}
|
|
396
359
|
}
|
|
397
360
|
|
|
361
|
+
if !options.mediaSubtypes.isEmpty {
|
|
362
|
+
// include assets that match at least one of the requested subtypes
|
|
363
|
+
let mask = options.mediaSubtypes
|
|
364
|
+
.map { $0.toPHAssetMediaSubtype().rawValue }
|
|
365
|
+
.reduce(0, |)
|
|
366
|
+
|
|
367
|
+
let subtypesPredicate = NSPredicate(
|
|
368
|
+
format: "(mediaSubtypes & %d) != 0", mask
|
|
369
|
+
)
|
|
370
|
+
predicates.append(subtypesPredicate)
|
|
371
|
+
}
|
|
372
|
+
|
|
398
373
|
if !options.sortBy.isEmpty {
|
|
399
374
|
do {
|
|
400
375
|
fetchOptions.sortDescriptors = try prepareSortDescriptors(sortBy: options.sortBy)
|
|
@@ -427,18 +402,14 @@ func getAssetsWithAfter(options: AssetWithOptions, collection: PHAssetCollection
|
|
|
427
402
|
fetchOptions.includeAllBurstAssets = false
|
|
428
403
|
fetchOptions.includeHiddenAssets = false
|
|
429
404
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
fetchResult = PHAsset.fetchAssets(in: collection, options: fetchOptions)
|
|
405
|
+
let fetchResult: PHFetchResult<PHAsset> = if let collection {
|
|
406
|
+
PHAsset.fetchAssets(in: collection, options: fetchOptions)
|
|
433
407
|
} else {
|
|
434
|
-
|
|
408
|
+
PHAsset.fetchAssets(with: fetchOptions)
|
|
435
409
|
}
|
|
436
410
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
return fetchResult.index(of: cursor)
|
|
440
|
-
}
|
|
441
|
-
return NSNotFound
|
|
411
|
+
let cursorIndex = if let cursor { fetchResult.index(of: cursor) } else {
|
|
412
|
+
NSNotFound
|
|
442
413
|
}
|
|
443
414
|
|
|
444
415
|
let resultingAssets = getAssets(
|
|
@@ -482,9 +453,8 @@ func getAssets(
|
|
|
482
453
|
|
|
483
454
|
for i in stride(from: upperIndex, to: lowerIndex, by: -1) {
|
|
484
455
|
let asset = fetchResult.object(at: i)
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}
|
|
456
|
+
let exportedAsset = exportAsset(asset: asset)
|
|
457
|
+
assets.append(exportedAsset)
|
|
488
458
|
}
|
|
489
459
|
|
|
490
460
|
hasNextPage = lowerIndex >= 0
|
|
@@ -494,9 +464,8 @@ func getAssets(
|
|
|
494
464
|
|
|
495
465
|
for index in startIndex..<endIndex {
|
|
496
466
|
let asset = fetchResult.object(at: index)
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}
|
|
467
|
+
let exportedAsset = exportAsset(asset: asset)
|
|
468
|
+
assets.append(exportedAsset)
|
|
500
469
|
}
|
|
501
470
|
|
|
502
471
|
hasNextPage = endIndex < totalCount
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "host.exp.exponent",
|
|
5
5
|
"module": "expo.modules.medialibrary",
|
|
6
|
-
"version": "17.
|
|
6
|
+
"version": "17.2.0-canary-20250713-8f814f8",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
],
|
|
34
34
|
"files": [
|
|
35
35
|
{
|
|
36
|
-
"name": "expo.modules.medialibrary-17.
|
|
37
|
-
"url": "expo.modules.medialibrary-17.
|
|
36
|
+
"name": "expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.aar",
|
|
37
|
+
"url": "expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.aar",
|
|
38
38
|
"size": 204627,
|
|
39
39
|
"sha512": "234c3a5435c12fec1739959664791775cd1a4722f66e017bc9c4a372b266dc996f6473715fec4df5a8a59893cf5abae38aff4cfbd1af058c708b8b194d990b38",
|
|
40
40
|
"sha256": "b8e7ca502c12ca092d218527c7a8be4422d038987ad1a6c6be31b2d471479603",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
],
|
|
77
77
|
"files": [
|
|
78
78
|
{
|
|
79
|
-
"name": "expo.modules.medialibrary-17.
|
|
80
|
-
"url": "expo.modules.medialibrary-17.
|
|
79
|
+
"name": "expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.aar",
|
|
80
|
+
"url": "expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8.aar",
|
|
81
81
|
"size": 204627,
|
|
82
82
|
"sha512": "234c3a5435c12fec1739959664791775cd1a4722f66e017bc9c4a372b266dc996f6473715fec4df5a8a59893cf5abae38aff4cfbd1af058c708b8b194d990b38",
|
|
83
83
|
"sha256": "b8e7ca502c12ca092d218527c7a8be4422d038987ad1a6c6be31b2d471479603",
|
|
@@ -96,8 +96,8 @@
|
|
|
96
96
|
},
|
|
97
97
|
"files": [
|
|
98
98
|
{
|
|
99
|
-
"name": "expo.modules.medialibrary-17.
|
|
100
|
-
"url": "expo.modules.medialibrary-17.
|
|
99
|
+
"name": "expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8-sources.jar",
|
|
100
|
+
"url": "expo.modules.medialibrary-17.2.0-canary-20250713-8f814f8-sources.jar",
|
|
101
101
|
"size": 32734,
|
|
102
102
|
"sha512": "b9f79e9862f5b00f731e10bce15655da2f8793ce0082aa2b1a5e53602b61c61ee783a6cb7658b9a41cbf26a0c5eb7e50bc212cd91996953d2434d7edb9385a9d",
|
|
103
103
|
"sha256": "f16e0c8bbe9a2d32ae2da8d5bc4a960b21af606afa12f08dde43dcaf7e724942",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5e591d0161474ac667413debbd691373
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
02931bc7bbe658bd0ec0cbc2b6ea3fd78f33a7c9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
7c332adf8d1111ab2016bbcde53c693f678d6463225a4d70816a87c07cc32947
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dbd8d13431b16e94166928485a8d083b15b0857bda56b6e52e4b9c3ac4b5cf387a708796eeacd35d2413c74704b27dfbe6682d2fb128a38ad3273f8335a60583
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>host.exp.exponent</groupId>
|
|
11
11
|
<artifactId>expo.modules.medialibrary</artifactId>
|
|
12
|
-
<version>17.
|
|
12
|
+
<version>17.2.0-canary-20250713-8f814f8</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.medialibrary</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
b296b4ead3ff1dcec05458dd3013810d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
a93d5774938732e94ab6497723e4422e8c8ea745
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
776343f9f3909f6b60c13d03e927257539678e62c959f2dfafb692eeda89fa9c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3831601848da0dfb8f2de2874e3a9530e71bf2be77ea882960c5967010d7b3174e97332c18f20e02f2bc517f3bbb10f992384b62b36baf3cb0e492860008c48b
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>host.exp.exponent</groupId>
|
|
4
4
|
<artifactId>expo.modules.medialibrary</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>17.
|
|
7
|
-
<release>17.
|
|
6
|
+
<latest>17.2.0-canary-20250713-8f814f8</latest>
|
|
7
|
+
<release>17.2.0-canary-20250713-8f814f8</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>17.
|
|
9
|
+
<version>17.2.0-canary-20250713-8f814f8</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20250713133453</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
904ea328a8d0db70658a6b3e7fa96946
|
package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/maven-metadata.xml.sha1
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4ff77280297d2c68c6652da058126389cdc963b1
|
package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/maven-metadata.xml.sha256
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
7d6e42a57896345fddc7f9ea19800916e90e2054060c981f980650c45028f11f
|
package/local-maven-repo/host/exp/exponent/expo.modules.medialibrary/maven-metadata.xml.sha512
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1e945cce63184023affbe7f6ffeb05fcd2611bece924d710bef52441b267a147b81da49a5b15882b142ae9f98ad85e47cd94f65907805e4baac054166a6c7f30
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-media-library",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.2.0-canary-20250713-8f814f8",
|
|
4
4
|
"description": "Provides access to user's media library.",
|
|
5
5
|
"main": "build/MediaLibrary.js",
|
|
6
6
|
"types": "build/MediaLibrary.d.ts",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"preset": "expo-module-scripts"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"expo-module-scripts": "4.1.10-canary-
|
|
41
|
+
"expo-module-scripts": "4.1.10-canary-20250713-8f814f8"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"expo": "54.0.0-canary-
|
|
44
|
+
"expo": "54.0.0-canary-20250713-8f814f8",
|
|
45
45
|
"react-native": "*"
|
|
46
46
|
},
|
|
47
47
|
"codegenConfig": {
|
package/src/MediaLibrary.ts
CHANGED
|
@@ -168,7 +168,8 @@ export type AssetInfo = Asset & {
|
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
170
|
* Constants identifying specific variations of asset media, such as panorama or screenshot photos,
|
|
171
|
-
* and time-lapse or high-frame-rate video. Maps to [
|
|
171
|
+
* and time-lapse or high-frame-rate video. Maps to [`PHAssetMediaSubtype`](https://developer.apple.com/documentation/photokit/phassetmediasubtype#1603888).
|
|
172
|
+
* @platform ios
|
|
172
173
|
* */
|
|
173
174
|
export type MediaSubtype =
|
|
174
175
|
| 'depthEffect'
|
|
@@ -178,7 +179,9 @@ export type MediaSubtype =
|
|
|
178
179
|
| 'panorama'
|
|
179
180
|
| 'screenshot'
|
|
180
181
|
| 'stream'
|
|
181
|
-
| 'timelapse'
|
|
182
|
+
| 'timelapse'
|
|
183
|
+
| 'spatialMedia'
|
|
184
|
+
| 'videoCinematic';
|
|
182
185
|
|
|
183
186
|
// @needsAudit
|
|
184
187
|
export type MediaLibraryAssetInfoQueryOptions = {
|
|
@@ -306,6 +309,11 @@ export type AssetsOptions = {
|
|
|
306
309
|
* @default MediaType.photo
|
|
307
310
|
*/
|
|
308
311
|
mediaType?: MediaTypeValue[] | MediaTypeValue;
|
|
312
|
+
/**
|
|
313
|
+
* An array of [MediaSubtype](#mediasubtype)s or a single `MediaSubtype`.
|
|
314
|
+
* @platform ios
|
|
315
|
+
*/
|
|
316
|
+
mediaSubtypes?: MediaSubtype[] | MediaSubtype;
|
|
309
317
|
/**
|
|
310
318
|
* `Date` object or Unix timestamp in milliseconds limiting returned assets only to those that
|
|
311
319
|
* were created after this date.
|
|
@@ -819,7 +827,8 @@ export async function getAssetsAsync(assetsOptions: AssetsOptions = {}): Promise
|
|
|
819
827
|
throw new UnavailabilityError('MediaLibrary', 'getAssetsAsync');
|
|
820
828
|
}
|
|
821
829
|
|
|
822
|
-
const { first, after, album, sortBy, mediaType, createdAfter, createdBefore } =
|
|
830
|
+
const { first, after, album, sortBy, mediaType, createdAfter, createdBefore, mediaSubtypes } =
|
|
831
|
+
assetsOptions;
|
|
823
832
|
|
|
824
833
|
const options = {
|
|
825
834
|
first: first == null ? 20 : first,
|
|
@@ -827,6 +836,7 @@ export async function getAssetsAsync(assetsOptions: AssetsOptions = {}): Promise
|
|
|
827
836
|
album: getId(album),
|
|
828
837
|
sortBy: arrayize(sortBy),
|
|
829
838
|
mediaType: arrayize(mediaType || [MediaType.photo]),
|
|
839
|
+
mediaSubtypes: arrayize(mediaSubtypes),
|
|
830
840
|
createdAfter: dateToNumber(createdAfter),
|
|
831
841
|
createdBefore: dateToNumber(createdBefore),
|
|
832
842
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9edd2cdce7a0849154fa4b7d89fef60e
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9164cb95ab87f1e99d3e3e573360edd574266e9d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7a0cf64a4b2d5044b81f1208c92456ad79f25ed832028198b91e8d024a74d4b9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
264b2eb8fcf908640edd65416042217a44183df4fc7b85a3c35d17081d4e95eec356ff79b3f43916229cc4cd79b6b9c3841dcd36420a21db9f365a7c5c5cc31d
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
19f43eb88768c562a6d8ac85e4a657d9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2bfd03b6f24a00549e12c92555a5e46f0f57b285
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
369368879df880b6b052270d4ab18a535a34626db44af2d7e937ec061b2096b5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f908b4b3dc65bbffdeb8cedf9ad41be4a546d8076eee5d5710414df2602da40efeb375ffcfc7cfbb4e1e04e843b9359822cfca758cd3bd6d8accd152e051a370
|
|
File without changes
|