RaphaelWoude/capacitor-native-settings

add activityResult to improve promise usability on Android

setoba1192 opened this issue · 2 comments

Adds usability to then promise in the method NativeSettings.open to trigger some method when user gets back to screen

Platform:

Android

Current Behavior: Then promise execute immediately when call open method
New Behavior: Then promise wait to user gets back to screen

openSettingsTurnOnLocation = () => {
    const options = {
      optionAndroid: AndroidSettings.ApplicationDetails,
      optionIOS: IOSSettings.App,
    };

    NativeSettings.open(options).then((data) => {
      this.presentAlert('then execution', JSON.stringify(data), '');
    });
  };

I created a pull request to add this enhancement #31

Hi. I think this would be a great addition to the plugin. I just commented on your PR.

Live in v5.0.0