Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requestTrackingPermission crash the app [OS 14.5.1] #9

Open
OleksiyTrofimenko opened this issue May 13, 2021 · 10 comments
Open

requestTrackingPermission crash the app [OS 14.5.1] #9

OleksiyTrofimenko opened this issue May 13, 2021 · 10 comments

Comments

@OleksiyTrofimenko
Copy link

Hi, thank you for your library. I've set up action inside my root component, to call prompt modal

It's very simple but anyway app crashed when requestTrackingPermission() triggered

`const onCheckUserTrackingPermission = useCallback(async () => {
try {
const trackingStatus = await getTrackingStatus();

  if (trackingStatus === 'not-determined') {
    return await requestTrackingPermission();
  }

  if (trackingStatus === 'authorized' || trackingStatus === 'unavailable') {
    return;
  }
} catch (error) {}

}, []);

useEffect(() => { onCheckUserTrackingPermission(); }, [onCheckUserTrackingPermission]);

@mrousavy
Copy link
Owner

Can you share the crashlogs? Check your native logs window in Xcode.

Did you edit your Info.plist to add a tracking info description?

@OleksiyTrofimenko
Copy link
Author

@mrousavy, unfortunately, logs are clear, through the cycle of executing my component, I've used a log to this case

and the last message that I've faced it's status of const trackingStatus = await getTrackingStatus();

that shows not-determined

Yes, I edit Info.plist and added the required key with the description. The problem that on the emulator everything works fine, but on real device, after requestTrackingPermission called, my app crashed

@axeljeremy7
Copy link

axeljeremy7 commented May 18, 2021

I have NSUserTrackingUsageDescription in my Info.plist and I remember this was working before this version.
I have error for message: :"null is not an object (evaluating 's.requestTrackingPermission') and name: TypeError

      const trackingStatus = await requestTrackingPermission();
      logInfoInstabug(trackingStatus, 'trackingStatus');
      report(trackingStatus, 'trackingStatus:');
    } catch (e) {
      report(e, 'requestTrackingPermission() Error');
      reportErrorInstabug(e, 'requestTrackingPermission() Error');
    }

@Giacomo92
Copy link

I have the same error "null is not an object (evaluating 'TrackingTransparency.getTrackingStatus')"

How can I solve this? @mrousavy

@ViktorVojtek
Copy link

Hey guys. Removing the app from simulator/real device, removing Pods folder, reinstalling pods and reseting the metro cache with react-native start --reset-cache did work for me.

@ncthang198
Copy link

ncthang198 commented May 21, 2021

I have the same error "null is not an object (evaluating 'TrackingTransparency.getTrackingStatus')"

How can I solve this? @mrousavy

I have NSUserTrackingUsageDescription in my Info.plist and I remember this was working before this version.
I have error for message: :"null is not an object (evaluating 's.requestTrackingPermission') and name: TypeError

      const trackingStatus = await requestTrackingPermission();
      logInfoInstabug(trackingStatus, 'trackingStatus');
      report(trackingStatus, 'trackingStatus:');
    } catch (e) {
      report(e, 'requestTrackingPermission() Error');
      reportErrorInstabug(e, 'requestTrackingPermission() Error');
    }

I also had the same situation as you. I try adding pod 'react-native-tracking-transparency', :path => '../node_modules/react-native-tracking-transparency' in Podfile then pod install. This work for me.

@karthick-t2s
Copy link

I have the same error "null is not an object (evaluating 'TrackingTransparency.getTrackingStatus')"
How can I solve this? @mrousavy

I have NSUserTrackingUsageDescription in my Info.plist and I remember this was working before this version.
I have error for message: :"null is not an object (evaluating 's.requestTrackingPermission') and name: TypeError

      const trackingStatus = await requestTrackingPermission();
      logInfoInstabug(trackingStatus, 'trackingStatus');
      report(trackingStatus, 'trackingStatus:');
    } catch (e) {
      report(e, 'requestTrackingPermission() Error');
      reportErrorInstabug(e, 'requestTrackingPermission() Error');
    }

I also had the same situation as you. I try adding pod 'react-native-tracking-transparency', :path => '../node_modules/react-native-tracking-transparency' in Podfile then pod install. This work for me.

It's still crashing :(

@teivienn
Copy link

Have you added NSUserTrackingUsageDescription to info.plist?

@piyushbeli
Copy link

pod 'react-native-tracking-transparency', :path => '../node_modules/react-native-tracking-transparency'

Works for me too.

@vladdeSV
Copy link

vladdeSV commented Dec 8, 2021

Hey guys. Removing the app from simulator/real device, removing Pods folder, reinstalling pods and reseting the metro cache with react-native start --reset-cache did work for me.

Thank you so much for this solution. Have been stuck at this, and this fixed the issue. I am unsure why or which step solved it, but it works now!

react: 16.11.0
react-native: 0.62.2
react-native-tracking-transparency 0.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants