大家好,我正在使用react原生admob的库,但是,有人知道我如何让人们通过按钮点击广告吗?例如,在视频上输入全屏,我想在这上面实现一个广告新闻。不过,我该怎么做呢?到目前为止,该库给出了显示广告横幅的代码。
https://github.com/sbugert/react-native-admob
<AdMobBanner
adSize="fullBanner"
adUnitID="your-admob-unit-id"
testDevices={[AdMobBanner.simulatorId]}
onAdFailedToLoad={error => console.error(error)}
/>发布于 2018-10-02 18:39:45
这些被称为有偿视频广告。不是横幅。要执行您想要的操作,代码应如下所示:
// Set up the rewarded ad
AdMobRewarded.setAdUnitID('your-admob-unit-id');
AdMobRewarded.requestAd()
....
// Start the video ad
setTimeout(() => { // Connect this to a function instead of a timeout obviously
AdMobRewarded.showAd()
}, 5000)有关代码用法的完整示例,请参阅https://github.com/sbugert/react-native-admob插件。
发布于 2018-04-24 02:49:15
据我所知,这是不可能添加您自己的横幅设计。我尝试了一下reac-native-admob,然后用facebook react-native-fbads的一个类似的包做了一些基本的工作。我的经验是,后者更灵活一些。然而,我不认为他们会变得比admob的原始版本更好。但至少你可以添加按钮。
https://stackoverflow.com/questions/49981993
复制相似问题