# Add Meta Audience Network ads to an iOS app

Serve Meta Audience Network ads in your IAB ad views. This is an optional module of the IAB Standard Size Experience SDK for iOS. Set up the SDK first by following [Add IAB Standard Size Experiences to an iOS app](https://begenuin.com/developers/developer-resources/sdk/integrate-the-genuin-ad-sdk-for-ios), then add Meta Audience Network here.

## Step 1: Add the modules

1. In your project, open the Genuin package (`https://github.com/genuininc/ios_sdk`) and add the `GenuinMetaAds` product to your app target.
2. Add Meta's package as well. Meta's SDK can't be bundled into `GenuinMetaAds`, so go to **File** > **Add Package Dependencies**, enter `https://github.com/facebook/FBAudienceNetwork`, set **Dependency Rule** to **Exact Version** `6.22.1`, and add the `FBAudienceNetwork` product to your app target.

Without Meta's package the app crashes at launch with `Library not loaded: @rpath/FBAudienceNetwork.framework`.

## Step 2: Configure Info.plist

Add Meta's SKAdNetwork identifiers under `SKAdNetworkItems`. Use the same array for any other ad network you use.

```xml title="Info.plist"
<key>SKAdNetworkItems</key>
<array>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>v9wttpbfk9.skadnetwork</string>
    </dict>
    <dict>
        <key>SKAdNetworkIdentifier</key>
        <string>n38lu8286q.skadnetwork</string>
    </dict>
</array>
```

Meta can change this list, so check [Meta's SKAdNetwork page](https://developers.facebook.com/docs/setting-up/platform-setup/ios/SKAdNetwork).

## Step 3: Register the module

Pass `BGMetaAds.module` when you initialize the SDK in [Step 6](https://begenuin.com/developers/developer-resources/sdk/integrate-the-genuin-ad-sdk-for-ios#step-6-initialize-the-sdk). Adding the product isn't enough: a module you don't pass isn't registered, and its ads are skipped silently.

```swift title="MyApp.swift"
import GenuinSDK
import GenuinInStreamAds
import GenuinMetaAds

Genuin.shared.initialize(
    modules: [BGInStreamAds.module, BGMetaAds.module],
    apiKey: "<<YOUR_API_KEY>>"
)
```

## Where Meta ads appear

Meta serves native video, image, and carousel ads in views at least 175 points tall: `BG300x250AdView`, `BG320x480AdView`, and `BG300x600AdView`. It doesn't serve `BG320x50AdView` or `BG320x100AdView`, so those use the next ad source.

## Troubleshooting

| Symptom | Cause | Fix |
| --- | --- | --- |
| The app crashes at launch with Library not loaded: @rpath/FBAudienceNetwork.framework | You added GenuinMetaAds without Meta's package | Add FBAudienceNetwork 6.22.1 to the app target (Step 1). |
| No Meta ads appear | The module isn't passed to initialize, Meta isn't enabled for your tag, or the view is shorter than 175 points | Pass BGMetaAds.module (Step 3), ask your Genuin team to enable Meta for your tag IDs, and use a taller view. |
| Meta returns no fill | Meta hasn't approved your app yet, or it has no ad to serve | Wait for Meta's approval. This isn't a problem with your integration. |

## See also

- [Add IAB Standard Size Experiences to an iOS app](https://begenuin.com/developers/developer-resources/sdk/integrate-the-genuin-ad-sdk-for-ios)
- [Add Pangle ads to an iOS app](https://begenuin.com/developers/developer-resources/sdk/add-pangle-ads-to-an-ios-app)
- [Add Google Ad Manager ads to an iOS app](https://begenuin.com/developers/developer-resources/sdk/add-google-ad-manager-ads-to-an-ios-app)
