> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.openSetting

> Open the Mini Program settings page.

Use this API to open the Mini Program settings page and return permission setting results. Only the permissions that have been requested by the Mini Program from the user are displayed on the settings page.

## Parameters

| Property | Type     | Required | Description                               |
| -------- | -------- | -------- | ----------------------------------------- |
| success  | Function | No       | Callback on success with current settings |
| fail     | Function | No       | Callback on failure                       |
| complete | Function | No       | Callback that always executes             |

## Success Callback Parameters

| Property    | Type   | Description                                                                                                                                          |
| ----------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| authSetting | Object | Results of user authorization. Keys are the values of scopes and values are boolean types, which shows whether the user gives the permission or not. |

## authSetting Object

| Property | Type    | Description                                                              |
| -------- | ------- | ------------------------------------------------------------------------ |
| location | Boolean | Whether location permission (my.getLocation) is granted                  |
| camera   | Boolean | Whether camera permission (my.scan) is granted                           |
| album    | Boolean | Whether photo album permission (my.chooseImage, my.saveImage) is granted |
| userInfo | Boolean | Whether user info permission (my.getOpenUserInfo) is granted             |

## Code Example

### Basic Usage

```javascript theme={null}
my.openSetting({
  success(res) {
    console.log('Current settings:', res.authSetting);
  }
});
```

### Check and Request Permission

```javascript theme={null}
Page({
  async requestLocation() {
    my.getLocation({
      success: (res) => {
        this.handleLocationSuccess(res);
      },
      fail: (err) => {
        // Permission denied, guide user to settings
        my.confirm({
          title: 'Permission Required',
          content: 'Location permission is needed. Would you like to enable it in settings?',
          confirmButtonText: 'Open Settings',
          success: (result) => {
            if (result.confirm) {
              my.openSetting({
                success: (settingRes) => {
                  if (settingRes.authSetting.location) {
                    // Permission granted, try again
                    this.requestLocation();
                  }
                }
              });
            }
          }
        });
      }
    });
  }
});
```

### Permission Management Page

```javascript theme={null}
Page({
  data: {
    permissions: {}
  },

  onShow() {
    this.loadPermissions();
  },

  loadPermissions() {
    my.openSetting({
      success: (res) => {
        this.setData({ permissions: res.authSetting });
      }
    });
  },

  managePermissions() {
    my.openSetting({
      success: (res) => {
        this.setData({ permissions: res.authSetting });
        my.showToast({ content: 'Settings updated' });
      }
    });
  }
});
```

<Tip>
  Use this API to guide users to re-enable permissions they previously denied. Always explain why the permission is needed before opening settings.
</Tip>

## Related APIs

<CardGroup cols={2}>
  <Card title="my.getLocation" icon="location-dot" href="/jsapi/location/my.getLocation">
    Get location
  </Card>

  <Card title="my.chooseImage" icon="image" href="/jsapi/media/image/my.chooseImage">
    Choose image
  </Card>
</CardGroup>
