Skip to content

Commit f91adeb

Browse files
Update Native Mobile Resources module to v6.0.1
1 parent 1680ea3 commit f91adeb

File tree

216 files changed

+50638
-50700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+50638
-50700
lines changed

Diff for: Atlas_UI_Reference_App.mpr

0 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1+
import TouchID from 'react-native-touch-id';
2+
13
// This file was generated by Mendix Studio Pro.
2-
//
3-
// WARNING: Only the following code will be retained when actions are regenerated:
4-
// - the import list
5-
// - the code between BEGIN USER CODE and END USER CODE
6-
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7-
// Other code you write will be lost the next time you deploy the project.
8-
import { Big } from "big.js";
9-
import TouchID from 'react-native-touch-id';
10-
114
// BEGIN EXTRA CODE
125
// END EXTRA CODE
13-
146
/**
157
* @param {string} reason - The reason for requesting authentication. If empty, the system default message is used.
168
* @returns {Promise.<boolean>}
179
*/
18-
export async function BiometricAuthentication(reason) {
19-
// BEGIN USER CODE
10+
async function BiometricAuthentication(reason) {
11+
// BEGIN USER CODE
2012
// Documentation https://github.com/naoufal/react-native-touch-id
2113
return TouchID.authenticate(reason)
2214
.then(() => true)
2315
.catch(() => false);
24-
// END USER CODE
25-
}
16+
// END USER CODE
17+
}
18+
19+
export { BiometricAuthentication };
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1+
import { Platform, NativeModules } from 'react-native';
2+
import PushNotification from 'react-native-push-notification';
3+
14
// This file was generated by Mendix Studio Pro.
2-
//
3-
// WARNING: Only the following code will be retained when actions are regenerated:
4-
// - the import list
5-
// - the code between BEGIN USER CODE and END USER CODE
6-
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7-
// Other code you write will be lost the next time you deploy the project.
8-
import { Big } from "big.js";
9-
import { Platform, NativeModules } from 'react-native';
10-
import PushNotification from 'react-native-push-notification';
11-
125
// BEGIN EXTRA CODE
136
// END EXTRA CODE
14-
157
/**
168
* Cancels all pending scheduled notifications.
179
* @returns {Promise.<void>}
1810
*/
19-
export async function CancelAllScheduledNotifications() {
20-
// BEGIN USER CODE
11+
async function CancelAllScheduledNotifications() {
12+
// BEGIN USER CODE
2113
// Documentation https://github.com/zo0r/react-native-push-notification
2214
const isIOS = Platform.OS === "ios";
2315
if (NativeModules && isIOS && !NativeModules.RNCPushNotificationIOS) {
2416
return Promise.reject(new Error("Notifications module is not available in your app"));
2517
}
2618
PushNotification.cancelAllLocalNotifications();
2719
return Promise.resolve();
28-
// END USER CODE
29-
}
20+
// END USER CODE
21+
}
22+
23+
export { CancelAllScheduledNotifications };
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
1+
import { Platform, NativeModules } from 'react-native';
2+
import PushNotification from 'react-native-push-notification';
3+
14
// This file was generated by Mendix Studio Pro.
2-
//
3-
// WARNING: Only the following code will be retained when actions are regenerated:
4-
// - the import list
5-
// - the code between BEGIN USER CODE and END USER CODE
6-
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7-
// Other code you write will be lost the next time you deploy the project.
8-
import { Big } from "big.js";
9-
import { Platform, NativeModules } from 'react-native';
10-
import PushNotification from 'react-native-push-notification';
11-
125
// BEGIN EXTRA CODE
136
// END EXTRA CODE
14-
157
/**
168
* @param {string} notificationId - This field is required.
179
* @returns {Promise.<void>}
1810
*/
19-
export async function CancelScheduledNotification(notificationId) {
20-
// BEGIN USER CODE
11+
async function CancelScheduledNotification(notificationId) {
12+
// BEGIN USER CODE
2113
// Documentation https://github.com/zo0r/react-native-push-notification
2214
const isIOS = Platform.OS === "ios";
2315
if (NativeModules && isIOS && !NativeModules.RNCPushNotificationIOS) {
@@ -28,5 +20,7 @@ export async function CancelScheduledNotification(notificationId) {
2820
}
2921
PushNotification.cancelLocalNotification(notificationId);
3022
return Promise.resolve();
31-
// END USER CODE
32-
}
23+
// END USER CODE
24+
}
25+
26+
export { CancelScheduledNotification };

Diff for: javascriptsource/nativemobileresources/actions/ChangeStatusBar.js

+8-16
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
1+
import { StatusBar, Platform } from 'react-native';
2+
13
// This file was generated by Mendix Studio Pro.
2-
//
3-
// WARNING: Only the following code will be retained when actions are regenerated:
4-
// - the import list
5-
// - the code between BEGIN USER CODE and END USER CODE
6-
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7-
// Other code you write will be lost the next time you deploy the project.
8-
import { Big } from "big.js";
9-
import { StatusBar, Platform } from 'react-native';
10-
11-
// BEGIN EXTRA CODE
12-
// END EXTRA CODE
13-
144
/**
155
* @param {"NativeMobileResources.StatusBarStyle.DefaultStyle"|"NativeMobileResources.StatusBarStyle.LightContentStyle"|"NativeMobileResources.StatusBarStyle.DarkContentStyle"} style - If empty, the current style is not changed.
166
* @param {boolean} hidden
@@ -21,8 +11,8 @@ import { StatusBar, Platform } from 'react-native';
2111
* @param {"NativeMobileResources.StatusBarHideShowAnimation.none"|"NativeMobileResources.StatusBarHideShowAnimation.fade"|"NativeMobileResources.StatusBarHideShowAnimation.slide"} animateHideShow - If empty, the default value 'none' is used.
2212
* @returns {Promise.<void>}
2313
*/
24-
export async function ChangeStatusBar(style, hidden, animateChanges, backgroundColor, translucent, networkActivityIndicatorVisible, animateHideShow) {
25-
// BEGIN USER CODE
14+
async function ChangeStatusBar(style, hidden, animateChanges, backgroundColor, translucent, networkActivityIndicatorVisible, animateHideShow) {
15+
// BEGIN USER CODE
2616
if (style) {
2717
StatusBar.setBarStyle(mapStyleEnum(style), animateChanges);
2818
}
@@ -49,5 +39,7 @@ export async function ChangeStatusBar(style, hidden, animateChanges, backgroundC
4939
return "dark-content";
5040
}
5141
}
52-
// END USER CODE
53-
}
42+
// END USER CODE
43+
}
44+
45+
export { ChangeStatusBar };
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
1+
import { Platform, NativeModules } from 'react-native';
2+
import PushNotification from 'react-native-push-notification';
3+
14
// This file was generated by Mendix Studio Pro.
2-
//
3-
// WARNING: Only the following code will be retained when actions are regenerated:
4-
// - the import list
5-
// - the code between BEGIN USER CODE and END USER CODE
6-
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7-
// Other code you write will be lost the next time you deploy the project.
8-
import { Big } from "big.js";
9-
import { Platform, NativeModules } from 'react-native';
10-
import PushNotification from 'react-native-push-notification';
11-
125
// BEGIN EXTRA CODE
136
// END EXTRA CODE
14-
157
/**
168
* Clears all delivered notifications from notification tray
179
* @returns {Promise.<void>}
1810
*/
19-
export async function ClearAllDeliveredNotifications() {
20-
// BEGIN USER CODE
11+
async function ClearAllDeliveredNotifications() {
12+
// BEGIN USER CODE
2113
// Documentation https://github.com/zo0r/react-native-push-notification
2214
const isIOS = Platform.OS === "ios";
2315
if (NativeModules && isIOS && !NativeModules.RNCPushNotificationIOS) {
2416
return Promise.reject(new Error("Notifications module is not available in your app"));
2517
}
2618
PushNotification.removeAllDeliveredNotifications();
2719
return Promise.resolve();
28-
// END USER CODE
29-
}
20+
// END USER CODE
21+
}
22+
23+
export { ClearAllDeliveredNotifications };

Diff for: javascriptsource/nativemobileresources/actions/DisplayNotification.js

+10-16
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
1+
import { Platform, NativeModules } from 'react-native';
2+
import PushNotification from 'react-native-push-notification';
3+
14
// This file was generated by Mendix Studio Pro.
2-
//
3-
// WARNING: Only the following code will be retained when actions are regenerated:
4-
// - the import list
5-
// - the code between BEGIN USER CODE and END USER CODE
6-
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7-
// Other code you write will be lost the next time you deploy the project.
8-
import { Big } from "big.js";
9-
import { Platform, NativeModules } from 'react-native';
10-
import PushNotification from 'react-native-push-notification';
11-
125
// BEGIN EXTRA CODE
136
// END EXTRA CODE
14-
157
/**
168
* Displays the specified notification straight away.
17-
*
9+
*
1810
* Note: It is not possible to display a notification whilst the app is in the foreground on iOS 9.
1911
* @param {string} body - This field is required.
2012
* @param {string} title
@@ -24,8 +16,8 @@ import PushNotification from 'react-native-push-notification';
2416
* @param {string} actionGuid
2517
* @returns {Promise.<void>}
2618
*/
27-
export async function DisplayNotification(body, title, subtitle, playSound, actionName, actionGuid) {
28-
// BEGIN USER CODE
19+
async function DisplayNotification(body, title, subtitle, playSound, actionName, actionGuid) {
20+
// BEGIN USER CODE
2921
// Documentation https://github.com/zo0r/react-native-push-notification
3022
const isIOS = Platform.OS === "ios";
3123
if (NativeModules && isIOS && !NativeModules.RNCPushNotificationIOS) {
@@ -64,5 +56,7 @@ export async function DisplayNotification(body, title, subtitle, playSound, acti
6456
}
6557
PushNotification.localNotification(notification);
6658
return Promise.resolve();
67-
// END USER CODE
68-
}
59+
// END USER CODE
60+
}
61+
62+
export { DisplayNotification };

Diff for: javascriptsource/nativemobileresources/actions/DownloadFile.js

+12-19
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
1+
import { Platform } from 'react-native';
2+
import RNBlobUtil from 'react-native-blob-util';
3+
import FileViewer from 'react-native-file-viewer';
4+
import mimeTypes from 'mime';
5+
16
// This file was generated by Mendix Studio Pro.
2-
//
3-
// WARNING: Only the following code will be retained when actions are regenerated:
4-
// - the import list
5-
// - the code between BEGIN USER CODE and END USER CODE
6-
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7-
// Other code you write will be lost the next time you deploy the project.
8-
import { Big } from "big.js";
9-
import { Platform } from 'react-native';
10-
import RNBlobUtil from 'react-native-blob-util';
11-
import FileViewer from 'react-native-file-viewer';
12-
import mimeTypes from 'mime';
13-
147
// BEGIN EXTRA CODE
158
function formatPath(...pathArgs) {
169
return pathArgs.filter(arg => !!arg).join("/");
@@ -31,15 +24,13 @@ async function getUniqueFilePath(path, fileName) {
3124
return uniqueFilePath;
3225
}
3326
// END EXTRA CODE
34-
3527
/**
3628
* @param {MxObject} file
37-
* @param {boolean} openWithOS - Set to True to let the OS open the file and ask the user with which applciation.
38-
Set to False if the file only needs to be saved to the device storage.
29+
* @param {boolean} openWithOS - Set to True to let the OS open the file and ask the user with which applciation.\nSet to False if the file only needs to be saved to the device storage.
3930
* @returns {Promise.<void>}
4031
*/
41-
export async function DownloadFile(file, openWithOS) {
42-
// BEGIN USER CODE
32+
async function DownloadFile(file, openWithOS) {
33+
// BEGIN USER CODE
4334
if (!file) {
4435
return Promise.reject(new Error("Input parameter 'file' is required"));
4536
}
@@ -67,5 +58,7 @@ export async function DownloadFile(file, openWithOS) {
6758
showAppsSuggestions: true
6859
});
6960
}
70-
// END USER CODE
71-
}
61+
// END USER CODE
62+
}
63+
64+
export { DownloadFile };
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
1+
import { Clipboard } from 'react-native';
2+
13
// This file was generated by Mendix Studio Pro.
2-
//
3-
// WARNING: Only the following code will be retained when actions are regenerated:
4-
// - the import list
5-
// - the code between BEGIN USER CODE and END USER CODE
6-
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7-
// Other code you write will be lost the next time you deploy the project.
8-
import { Big } from "big.js";
9-
import { Clipboard } from 'react-native';
10-
114
// BEGIN EXTRA CODE
125
// END EXTRA CODE
13-
146
/**
157
* @returns {Promise.<string>}
168
*/
17-
export async function GetClipboardContent() {
18-
// BEGIN USER CODE
9+
async function GetClipboardContent() {
10+
// BEGIN USER CODE
1911
// Documentation https://facebook.github.io/react-native/docs/clipboard#getstring
2012
return Clipboard.getString();
21-
// END USER CODE
22-
}
13+
// END USER CODE
14+
}
15+
16+
export { GetClipboardContent };
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1+
import { Big } from "big.js";
2+
import DeviceInfo from 'react-native-device-info';
3+
import { getLocales, getCountry, getTimeZone, uses24HourClock } from 'react-native-localize';
4+
15
// This file was generated by Mendix Studio Pro.
2-
//
3-
// WARNING: Only the following code will be retained when actions are regenerated:
4-
// - the import list
5-
// - the code between BEGIN USER CODE and END USER CODE
6-
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7-
// Other code you write will be lost the next time you deploy the project.
8-
import { Big } from "big.js";
9-
import DeviceInfo from 'react-native-device-info';
10-
import { getLocales, getCountry, getTimeZone, uses24HourClock } from 'react-native-localize';
11-
126
// BEGIN EXTRA CODE
137
// END EXTRA CODE
14-
158
/**
169
* @returns {Promise.<MxObject>}
1710
*/
18-
export async function GetDeviceInfo() {
19-
// BEGIN USER CODE
11+
async function GetDeviceInfo() {
12+
// BEGIN USER CODE
2013
return Promise.all([
2114
createMxObject("NativeMobileResources.DeviceInfo"),
2215
DeviceInfo.getBatteryLevel(),
@@ -26,8 +19,11 @@ export async function GetDeviceInfo() {
2619
DeviceInfo.getTotalMemory(),
2720
DeviceInfo.getCarrier(),
2821
DeviceInfo.getManufacturer(),
29-
DeviceInfo.getUserAgent()
30-
]).then(async ([mxObject, batteryLevel, fontScale, freeDiskStorage, totalDiskCapacity, totalMemory, carrier, manufacturer, userAgent]) => {
22+
DeviceInfo.getUserAgent(),
23+
DeviceInfo.getUniqueId(),
24+
DeviceInfo.isEmulator(),
25+
DeviceInfo.isLandscape()
26+
]).then(async ([mxObject, batteryLevel, fontScale, freeDiskStorage, totalDiskCapacity, totalMemory, carrier, manufacturer, userAgent, uniqueId, isEmulator, isLandscape]) => {
3127
const locales = getLocales();
3228
mxObject.set("ApplicationName", DeviceInfo.getApplicationName());
3329
mxObject.set("BatteryLevel", new Big(batteryLevel.toFixed(2)));
@@ -48,13 +44,13 @@ export async function GetDeviceInfo() {
4844
mxObject.set("Timezone", getTimeZone());
4945
mxObject.set("TotalDiskCapacity", new Big(totalDiskCapacity));
5046
mxObject.set("TotalMemory", new Big(totalMemory));
51-
mxObject.set("UniqueId", DeviceInfo.getUniqueId());
47+
mxObject.set("UniqueId", uniqueId);
5248
mxObject.set("UserAgent", userAgent);
5349
mxObject.set("Version", DeviceInfo.getVersion());
5450
mxObject.set("Is24Hour", uses24HourClock());
55-
mxObject.set("IsEmulator", DeviceInfo.isEmulator());
51+
mxObject.set("IsEmulator", isEmulator);
5652
mxObject.set("IsTablet", DeviceInfo.isTablet());
57-
mxObject.set("IsLandscape", DeviceInfo.isLandscape());
53+
mxObject.set("IsLandscape", isLandscape);
5854
mxObject.set("HasNotch", DeviceInfo.hasNotch());
5955
return mxObject;
6056
});
@@ -67,5 +63,7 @@ export async function GetDeviceInfo() {
6763
});
6864
});
6965
}
70-
// END USER CODE
71-
}
66+
// END USER CODE
67+
}
68+
69+
export { GetDeviceInfo };

0 commit comments

Comments
 (0)