github zoontek/react-native-permissions 3.7.1

latest releases: 5.1.0, 5.0.2, 5.0.1...
20 months ago
  • Only request the App Tracking Transparency iOS permission when the app is focused (as it's not allowed in background).
    This means that this code (which was a workaround):
useEffect(() => {
  const listener = AppState.addEventListener('change', (status) => {
    if (Platform.OS === 'ios' && status === 'active') {
      request(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY)
        .then((result) => console.log(result))
        .catch((error) => console.log(error));
    }
  });

  return listener.remove;
}, []);

       Can safely be replaced by:

useEffect(() => {
  if (Platform.OS === 'ios') {
    request(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY)
      .then((result) => console.log(result))
      .catch((error) => console.log(error));
  }
}, []);

Don't miss a new react-native-permissions release

NewReleases is sending notifications on new releases.