skip to Main Content

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);
            });
           
        } 

2

Answers


  1. Have you checked whether you have completely deactivated tracking on your device?

    If this toggle is off you are not even allowed to ask and show the popup.

    enter image description here

    Login or Signup to reply.
  2. We experience the same issue on iOS 17.4 using this package
    https://github.com/mrousavy/react-native-tracking-transparency

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search