Skip to content

Commit bced8a1

Browse files
[MOO-2252]: change the depricated function in SaveToPictureLibrary 11.8 (#485)
2 parents 4915387 + f54b118 commit bced8a1

4 files changed

Lines changed: 6 additions & 29 deletions

File tree

packages/jsActions/mobile-resources-native/CHANGELOG.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9-
## [11.4.2] Native Mobile Resources - 2026-4-9
10-
11-
## [5.0.4] BottomSheet
12-
13-
### Fixed
14-
15-
- Fixed the “non‑worklet function called on the UI thread” error in bottom sheet coming from @gorhom/bottom-sheet usage.
16-
- Fixed ExpandingDrawer to open correctly and show all elements.
17-
18-
### Changed
19-
20-
- Improved performance by memoizing all callbacks with useCallback and useMemo across all components.
21-
- BottomSheet now uses BottomSheetScrollView instead of BottomSheetView, enabling proper scrolling in expanded states.
22-
- NativeBottomSheet now explicitly calculates snapPoints with 90% screen height cap for predictable sizing.
23-
- CustomModalSheet now measures content height dynamically with 90% screen height cap, removing offscreen SafeAreaView measurement.
24-
25-
## [2.1.0] Gallery
26-
27-
### Changed
28-
29-
- We migrated from using the native FlatList to @shopify/flash-list.
30-
31-
## [4.3.0] IntroScreen
32-
339
### Changed
3410

35-
- We migrated from using the native FlatList to @shopify/flash-list.
11+
- We replaced the deprecated CameraRoll.saveToCameraRoll with CameraRoll.saveAsset in SaveToPictureLibrary activity.
12+
- Add await to API calls updated to async in recent update
3613

3714
## [11.4.1] Native Mobile Resources - 2026-3-14
3815

packages/jsActions/mobile-resources-native/src/camera/SaveToPictureLibrary.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ export async function SaveToPictureLibrary(picture?: mendix.lib.MxObject): Promi
2929

3030
const guid = picture.getGuid();
3131
const changedDate = picture.get("changedDate") as number;
32-
const url = mx.data.getDocumentUrl(guid, changedDate);
3332

3433
// Save the file as a photo to the camera roll.
3534
try {
36-
const savedUri = await CameraRoll.saveToCameraRoll(url, "auto");
35+
const url = await mx.data.getDocumentUrl(guid, changedDate);
36+
const savedUri = await CameraRoll.saveAsset(url);
3737
return Promise.resolve(savedUri.node.image.uri);
3838
} catch (error) {
3939
return Promise.reject(error);

packages/jsActions/mobile-resources-native/src/file-download/DownloadFile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export async function DownloadFile(file: mendix.lib.MxObject, openWithOS: boolea
6969
const fileName = file.get("Name") as string;
7070
const sanitizedFileName = sanitizeFileName(fileName);
7171
const baseDir = Platform.OS === "ios" ? dirs.DocumentDir : dirs.DownloadDir;
72-
const filePath = mx.data.getDocumentUrl(file.getGuid(), Number(file.get("changedDate")));
72+
const filePath = await mx.data.getDocumentUrl(file.getGuid(), Number(file.get("changedDate")));
7373
let accessiblePath;
7474

7575
if (Platform.OS === "ios") {

packages/jsActions/mobile-resources-native/src/platform/PlaySound.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ export async function PlaySound(audioFile?: mendix.lib.MxObject): Promise<void>
3232

3333
const guid = audioFile.getGuid();
3434
const changedDate = audioFile.get("changedDate") as number;
35-
const url = mx.data.getDocumentUrl(guid, changedDate);
3635

3736
try {
37+
const url = await mx.data.getDocumentUrl(guid, changedDate);
3838
// Initialize the player if it hasn't been set up yet
3939
const state = await TrackPlayer.getPlaybackState();
4040
if (state.state === State.None) {

0 commit comments

Comments
 (0)