RaphaelWoude / capacitor-native-settings

Capacitor plugin to open native settings screens for android and iOS
MIT License
95 stars 30 forks source link

add activityResult to improve promise usability on Android #33

Closed setoba1192 closed 1 year ago

setoba1192 commented 1 year ago

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

RaphaelWoude commented 1 year ago

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

RaphaelWoude commented 1 year ago

Live in v5.0.0