Expo FB Audience Network Ad Mediation with IronSource / MAX-AppLovin

757 Views Asked by At

I am using Expo and managed to show FB Audience Network Ad with below code. But FB now require ad bidding so I need to add at least one more advertising network, preferably IronSource or MAX/AppLovin. But all the document only show React Native setup only. I am very confused on:

  1. Do I need to setup another ad network ad in my Expo App? Or the current FB ad should show the ad with highest bidding automatically?
  2. Does Expo even capable to include IronSource or MAX/AppLovin ad at all, preferably without ejecting.
const [isLoaded, setIsLoaded] = useState(false);
  const bannerId =
    Platform.OS === "ios"
      ? "xxxxx"
      : "yyyyy";

FacebookAds.AdSettings.requestPermissionsAsync().then((permissions) => {
    let canTrack = permissions.status === "granted";
    FacebookAds.AdSettings.setAdvertiserTrackingEnabled(canTrack);
    setIsLoaded(true);
  });

  function getBannerAd() {
    if (isLoaded && !hasPurchased) {
      return (
        <FacebookAds.BannerAd
          placementId={bannerId}
          type="standard"
          onPress={() => console.log("click")}
          onError={(error) =>
            console.log("error from banner ", error.nativeEvent)
          }
        />
      );
    } else {
    }
  }

return {!hasPurchased && (
              <View
                style={{
                  backgroundColor: "white",
                  height: 50,
                  padding: 1,
                  width: width,
                }}
              >
                {getBannerAd()}
              </View>
            )}

Please let me know any thoughts or example on how to make FB Ad mediation work in Expo. Many thanks!

1

There are 1 best solutions below

0
On

I think I can give you a heads up, even though I have no direct experience with Meta Audience Network. I use the managed workflow too.

In the @expo/config-plugins package there's a bunch of utility functions that allow you to apply modifications to AndroidManifest.xml and build.gradle in Android and the PodFile in iOS programmatically at build time. You can basically add dependencies to the native projects like you would do in a bare workflow project, and if you use them directly in your app.config.js you don't even need to create a plug-in.

With the help of those functions I managed to install Applovin MAX along with a few mediation adapters without ejecting, and my project builds successfully even with the EAS Build service. I recently wrote an extensive article with some code examples. Maybe you can take inspiration from them!