通过react native expo应用货币化

时间:2019-07-12 18:05:21

标签: react-native expo ads

我正在制作React Native Expo应用程序。我想通过我的移动应用获利,但是expo sdk仅为您提供2个广告网络:admob和fb广告。

我不能使用任何此类网络。而我需要做什么?还有其他广告网络吗?

如果您能帮助我,我将非常感谢!

1 个答案:

答案 0 :(得分:0)

如果您想通过广告获利,可以使用Expo's admob module。从Google's admob获取所需的ID类型,然后将网络添加到该ID。

您可以将Unity和Facebook等著名的Nateworks添加到您的Google admob网络中。

用法

import {
  AdMobBanner,
  AdMobInterstitial,
  PublisherBanner,
  AdMobRewarded
} from 'expo-ads-admob';

// Display a banner
<AdMobBanner
  bannerSize="fullBanner"
  adUnitID="ca-app-pub-3940256099942544/6300978111" // Test ID, Replace with your-admob-unit-id
  testDeviceID="EMULATOR"
  onDidFailToReceiveAdWithError={this.bannerError} />

// Display a DFP Publisher banner
<PublisherBanner
  bannerSize="fullBanner"
  adUnitID="ca-app-pub-3940256099942544/6300978111" // Test ID, Replace with your-admob-unit-id
  testDeviceID="EMULATOR"
  onDidFailToReceiveAdWithError={this.bannerError}
  onAdMobDispatchAppEvent={this.adMobEvent} />

// Display an interstitial
AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id
AdMobInterstitial.setTestDeviceID('EMULATOR');
await AdMobInterstitial.requestAdAsync();
await AdMobInterstitial.showAdAsync();

// Display a rewarded ad
AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/5224354917'); // Test ID, Replace with your-admob-unit-id
AdMobRewarded.setTestDeviceID('EMULATOR');
await AdMobRewarded.requestAdAsync();
await AdMobRewarded.showAdAsync();