I have the following code in my react native application. Up until today, this worked as expected, but now, I am always receiving "blocked" as the result the first time the event fires, BEFORE the user has actually made a selection.

As such, the notification permission also fires because that function is no longer being waited on, which causes it to appear on top of the tracking modal. This looks bad, as it flicks the tracking one up first, then the notifications one, then after you respond to the notifications one, it shows the tracking one again.

No adverse affects other than not being able to use the result for things, unless calling it again later on.

Wondering how to fix this. Thanks for any help!

 if (Platform.OS === 'ios' && AppState.currentState == 'active') {
          await request(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY)
            .then(async (result) => {
              console.log('app trancking permissions result:', result);
              // do something with result

              await requestNotifications(['alert', 'sound']).then(({ status, settings }) => {
              console.log('request notification status: ', status);
            });
            })
            .catch((error) => {
              console.log('error in request tracking permissions: ', error);
            });
           
        } 
1

There are 1 best solutions below

0
Geoffrey On

It seems to be related to iOS 17.4. Probably due to Apple European Digital Markets Act (DMA).

The issue is also present on the sample project of react-native-permissions.

I've opened an issue for this case : https://github.com/zoontek/react-native-permissions/issues/857

Related Questions in REACT-NATIVE-PERMISSIONS