I can't get advertisingId on tvOS. I've tried react-native-advertising-id although I'm using typescript, and this lib other than not working, does not suit me because of lack of typing.
Then I switched to react-native-idfa-aaid which works pretty well until I run it on tvOS... This is the error I'm getting.
null is not an object (evaluating '_reactNativeIdfaAaid.default.getAdvertisingInfo')
It works good on android phone emulators and iOS phone emulators. Yes I can see in the lib description that it supports android/ios, not tvOS specified, yet I couldn't find anything that would explicitly support all of those platforms.
This is the code:
ReactNativeIdfaAaid.getAdvertisingInfo().then((res: AdvertisingInfoResponse) => {
if (res.isAdTrackingLimited) {
return {
id: '',
type,
};
}
return {
id: res.id!,
type,
};
}).catch(console.error);
Any help with getting advertisingId crossplatform using just reactNative would be appreciated.