How to use the react-native-permissions.openSettings function in react-native-permissions

To help you get started, we’ve selected a few react-native-permissions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mikelambert / dancedeets-monorepo / mobile / js / api / calendar.js View on Github external
}
  }

  if (status !== 'authorized') {
    if (status === 'restricted') {
      OkAlert('Cannot Access Calendar', 'Could not access calendar.');
      return false;
    } else if (status === 'denied') {
      try {
        // TODO(localization)
        await OkCancelAlert(
          'Cannot Access Calendar',
          'Please open Settings to allow Calendar permissions.'
        );
        if (await Permissions.canOpenSettings()) {
          Permissions.openSettings();
        }
      } catch (err) {
        console.log('Canceled: Add to Calendar Permissions');
      }
    }
    return false;
  }

  const { start, end } = getStartEndTime(event);

  try {
    CalendarEventsIOS.saveEvent(event.name, {
      location: event.venue.fullAddress(),
      notes: getDescription(event),
      startDate: start.toISOString(),
      endDate: end.toISOString(),
github react-native-community / react-native-permissions / example / App.js View on Github external
this.setState({ watchAppState: true }, () => {
                RNPermissions.openSettings();
              });
            }}
github goldennetwork / golden-wallet-react-native / app / modules / Setting / screen / SettingScreen.js View on Github external
onNotificationSwitch = () => {
    Platform.OS === 'ios' ? Permissions.openSettings() : Linking.openURL('settings://notification/golden')
  }
github square / react-native-square-reader-sdk / reader-sdk-react-native-quickstart / app / screens / PermissionScreenIOS.js View on Github external
async onOpenSettings() {
    if (!await this.checkPermissionsAndNavigateAsync()) {
      Permissions.openSettings();
    }
  }
github goldennetwork / golden-wallet-react-native / app / modules / ScanQRCode / index.js View on Github external
onClick: () => {
              Permissions.openSettings()
              NavStore.popupCustom.hide()
            }
          }
github react-native-community / react-native-permissions / example / App.js View on Github external
Permissions.canOpenSettings().then(canIt => {
      if (canIt) {
        return Permissions.openSettings();
      }

      Alert.alert(
        'Not supported',
        'openSettings is currently not supported on this platform',
      );
    });