Open platform settings app from Mendix native mobile app

2
Hi, I have a requirement to open platform’s (iOS/Android) settings → notifications on click of a button in my Mendix native mobile application. How can I achieve it. Thanks.
asked
1 answers
2

Hello Rahul

 

Maybe you can try use a custom JavaScript Action and the Linking API from React-Native, as shown in the code below:

 

import "mx-global";
import { Big } from "big.js";
import {Linking} from 'react-native';

// BEGIN EXTRA CODE
// END EXTRA CODE

/**
 * @returns {Promise.<void>}
 */
export async function JSA_Settings() {
	// BEGIN USER CODE
	Linking.openSettings();
	// END USER CODE
}

Then, you can call this Javascript action from a Nanoflow in your app

 

This will open the default settings page of your device.

https://reactnative.dev/docs/linking#opensettings

 

If you need to open another app or a specific page on Settings, you can try:

https://reactnative.dev/docs/linking#openurl

 

so, it would be like

Linking.openURL('app-settings://notification/myapp')

(not tested!)

 

Also, the code will be slightly different for IOS/Android:

https://stackoverflow.com/questions/60690479/how-to-open-app-settings-page-in-react-native-android

https://stackoverflow.com/questions/44582694/react-native-open-settings-through-linking-openurl-in-ios

 

 

Hope this helps!

 

 

answered