RaphaelWoude / capacitor-native-settings

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

adds activityResult to improve promise usability on Android #31

Closed setoba1192 closed 1 year ago

setoba1192 commented 1 year ago

Adds usability to then promise in the method NativeSettings.open

Platform:

Android


testMethod = () => {
    const options = {
      optionAndroid: AndroidSettings.ApplicationDetails,
      optionIOS: IOSSettings.App,
    };
    /**
     * Current Behavior: Then promise execute immediately
     * New Behavior: Then promise wait to user gets back to screen
     */
    NativeSettings.open(options).then((data) => {
      this.presentAlert('then execution', JSON.stringify(data), '');
    });
  };

https://user-images.githubusercontent.com/6577163/232974748-83e1f0f7-d999-4a7d-9c2e-e447c199fbea.mp4

RaphaelWoude commented 1 year ago

Thank you for your contribution. I will review & test your PR in the next couple days.

RaphaelWoude commented 1 year ago

This functionality will be available with the capacitor 5 build that is coming very soon. See https://github.com/RaphaelWoude/capacitor-native-settings/pull/32