Skip to main content
Version: 1.0.109

All Modules

All the methods like onPress, onLongPress, onStart and onEnd in framework has access to moduleParams parameter that has all the available modules.

A cheat sheet for all available modules to quickly start.

ModuleHow to use ?
navigation
  moduleParams["navigation"].navigate("AnotherScreen", { "name": "value" }) 
read complete details
route
  const name = moduleParams["route"].params["name"] 
read complete details
session
  moduleParams["session"].setValue("name", "value") 
read complete details
database
  moduleParams["database"].setData("books", {
"_id" : "1",
"name" : "Nice book by Nano",
"author" : "Mr. Author"
})
read complete details
deviceInfo
  const deviceId = moduleParams["deviceInfo"].getDeviceId() 
read complete details
alert
  moduleParams["alert"].alert('Alert Title', 'My Alert Msg', [
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel',
},
{text: 'OK', onPress: () => console.log('OK Pressed')},
])
read complete details
dimensions
  const windowHeight = moduleParams["dimensions"].windowHeight
const windowWidth = moduleParams["dimensions"].windowWidth
const screenHeight = moduleParams["dimensions"].screenHeight
const screenWidth = moduleParams["dimensions"].screenWidth

read complete details
linking
  await moduleParams["linking"].openURL("https://nanoapp.dev");

read complete details
share
try {
const result = await moduleParams["share"].share({
message:
'Nano | Makes mobile app development easier',
});
if (result.action === moduleParams["share"].sharedAction) {
if (result.activityType) {
// shared
} else {
// shared
}
} else if (result.action === moduleParams["share"].dismissedAction) {
// dismissed
}
} catch (error: any) {
console.log(error.message);
}
read complete details
appearance
const colorScheme = moduleParams["appearance"].getColorScheme();
if (colorScheme === 'dark') {
// Use dark color scheme
}
read complete details
interactionManager
moduleParams["interactionManager"].runAfterInteractions(() => {
// ...long-running synchronous task...
});
read complete details
platform
    const os =  moduleParams["platform"].OS;
read complete details
pixelRatio
    const size =  moduleParams["pixelRatio"].getPixelSizeForLayoutSize(200);
read complete details
layoutAnimation
moduleParams["layoutAnimation"].configureNext(moduleParams["layoutAnimation"].Presets.spring);
read complete details
uiManager
moduleParams["uiManager"].setLayoutAnimationEnabledExperimental(true);
read complete details
devSettings
moduleParams["devSettings"].addMenuItem('Show Secret Dev Screen', () => {
Alert.alert('Showing secret dev screen!');
});
read complete details
systrace
moduleParams["systrace"].setEnabled(true);
read complete details
vibration
const ONE_SECOND_IN_MS = 1000;

const PATTERN = [
1 * ONE_SECOND_IN_MS,
2 * ONE_SECOND_IN_MS,
3 * ONE_SECOND_IN_MS,
];

moduleParams["vibration"].vibrate(PATTERN)
read complete details