1

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.

majkelS
  • 592
  • 3
  • 6
  • `react-native-idfa-aaid` supports Android and iOS according to its README file. There is no mention of tvOS. – ridvanaltun Oct 17 '21 at 20:18
  • Would be great if you'd read the question before answering it! "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." and then "Any help with getting advertisingId crossplatform using just reactNative would be appreciated." – majkelS Oct 18 '21 at 06:48
  • Ouch, I didn't see that... – ridvanaltun Oct 18 '21 at 06:58

1 Answers1

1

Ended up writing my own native module, any further info on package updates supporting tvOS will be appreciated!

majkelS
  • 592
  • 3
  • 6