- 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));
}
}, []);