首页 > 解决方案 > 如何在本机反应中获得 IDFA 和 ADID?

问题描述

我想在 Android 上获取 ADID,在 IOS 上获取 IDFA,如何在 react native 上执行此操作?我使用这个名为react-native-idfa的库,但该库总是在 IDFA 上说未定义

标签: javascriptandroidiosreact-native

解决方案


我们遇到了同样的问题。确保你的 iAd.framework 链接到 Xcode -> “Build Phases”:

在此处输入图像描述

他们确实在他们的 github 上提到了这一点https://github.com/FreebirdRides/react-native-idfa#podfile

在“Link Binary With Libraries”下添加 AdSupport.framework:

在此处输入图像描述

如果您想使用我们的,我们分叉了 react-native-idfa:

https://github.com/FreebirdRides/react-native-idfa

这个提交特别是:

https://github.com/FreebirdRides/react-native-idfa/commit/9c6992a53dd109bed41e8c8300906a71e6068043


推荐阅读