RaphaelWoude / capacitor-native-settings

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

How should the return value be interpreted? #45

Open despinac opened 7 months ago

despinac commented 7 months ago

The open() function returns a Promise, which includes a boolean status. Could you elaborate on the scenarios, where the promise is

  1. resolved with a status true,
  2. resolved with status false,
  3. rejected

Thank you in advance!

stib commented 6 months ago

Looking to understand the meaning of returned status value as well. Would be great to get an answer.

Upon successful call to Native settings to open the dialog, it seems to immediately resolve with "true". Should the true value be interpreted as "the user was presented with a dialog to make a selection"? From trying to understand the source code (not very familiar with the plugin code structure) it seems to return with true/success upon opening the settings dialog.

Will be great to confirm.

Thank you.

RaphaelWoude commented 4 months ago

I don't think the functionality for the return value was ever finished. The plan was to give true or false based on the result of the activity (resultCode). A new version is in the works that handles the result of the activity to give true or false.