react-native-tracking-transparency
react-native-tracking-transparency copied to clipboard
requestTrackingPermission crash the app [OS 14.5.1]
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]);
Can you share the crashlogs? Check your native logs window in Xcode.
Did you edit your Info.plist to add a tracking info description?
@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
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 have the same error "null is not an object (evaluating 'TrackingTransparency.getTrackingStatus')"
How can I solve this? @mrousavy
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.
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.
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 thenpod install
. This work for me.
It's still crashing :(
Have you added NSUserTrackingUsageDescription to info.plist?
pod 'react-native-tracking-transparency', :path => '../node_modules/react-native-tracking-transparency'
Works for me too.
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