Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/jsActions/mobile-resources-native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- We replaced the depricated CameraRoll.saveToCameraRoll with CameraRoll.saveAsset in SaveToPictureLibrary activity.
Comment thread
MxKevinBeqo marked this conversation as resolved.
Outdated
- Add await to API calls updated to async in recent update

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

## [2.0.2] GalleryTextFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export async function SaveToPictureLibrary(picture?: mendix.lib.MxObject): Promi

const guid = picture.getGuid();
const changedDate = picture.get("changedDate") as number;
const url = mx.data.getDocumentUrl(guid, changedDate);
const url = await mx.data.getDocumentUrl(guid, changedDate);
Comment thread
MxKevinBeqo marked this conversation as resolved.
Outdated

// Save the file as a photo to the camera roll.
try {
const savedUri = await CameraRoll.saveToCameraRoll(url, "auto");
const savedUri = await CameraRoll.saveAsset(url);
return Promise.resolve(savedUri.node.image.uri);
} catch (error) {
return Promise.reject(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
* @returns {Promise.<void>}
*/

export async function DownloadFile(file: mendix.lib.MxObject, openWithOS: boolean) {

Check warning on line 62 in packages/jsActions/mobile-resources-native/src/file-download/DownloadFile.ts

View workflow job for this annotation

GitHub Actions / Unit tests

Missing return type on function
// BEGIN USER CODE
if (!file) {
return Promise.reject(new Error("Input parameter 'file' is required"));
Expand All @@ -69,7 +69,7 @@
const fileName = file.get("Name") as string;
const sanitizedFileName = sanitizeFileName(fileName);
const baseDir = Platform.OS === "ios" ? dirs.DocumentDir : dirs.DownloadDir;
const filePath = mx.data.getDocumentUrl(file.getGuid(), Number(file.get("changedDate")));
const filePath = await mx.data.getDocumentUrl(file.getGuid(), Number(file.get("changedDate")));
let accessiblePath;

if (Platform.OS === "ios") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export async function PlaySound(audioFile?: mendix.lib.MxObject): Promise<void>

const guid = audioFile.getGuid();
const changedDate = audioFile.get("changedDate") as number;
const url = mx.data.getDocumentUrl(guid, changedDate);
const url = await mx.data.getDocumentUrl(guid, changedDate);
Comment thread
MxKevinBeqo marked this conversation as resolved.
Outdated

try {
// Initialize the player if it hasn't been set up yet
Expand Down
Loading