📲 Project Creation (Step-by-Step)
AdsKit Setup

AdsKit Setup

Perform this setup if after you're done setting up DatabaseKit and AuthKit.

Create an AdMob Account

If you haven't already, create an AdMob Account (opens in a new tab).

Set up the first App

In your AdMob Dashboard, go to Apps in the sidebar, and press on Add App.

Add App

Select iOS as platform, and No, the App isn't listed yet. Press on Continue.

Select iOS

Enter the name of your app and press on Add App.

Enter App Name

Create Ad Unit ID

In the overview of your app in the AdMob Dashboard, press on Add Ad Unit.

Create

Because apps with AdsKit present ads that are natively integrated into the app, select Native Advanced as the ad format.

Select Ad Format

Enter a name for your ad unit (in our case NativeBanner1), select in advanced setting the media type to Image only, and press on Create Ad Unit.

💡

AdsKit currently only supports natively displayed banner, which doesn't support video ads.

Ad Unit Name Enter

Ad Unit Name Enter 2

On the next screen you'll see two important values. Write them down.

  1. First, is your AdMob App ID. This is the same for all ad units in your app.
  2. Second, is your Ad Unit ID. This is unique for each ad unit displayed in your application. So for each banner you want to display, you can create a new ad unit. But you could also just reuse the same ad unit for all banners.

Ad Unit Values

Adding AdMob App ID to your App

Add App ID to Info.plist

In your App's Info.plist, set the GADApplicationIdentifier to your AdMob App ID from the previous step.

Add App ID to Info.plist

Adding Network Items to Info.plist

Additionally, add following SKAdNetworkitems to your Info.plist. Since SwiftyLaunch 1.4.1, these are already automatically included in the Info.plist file. We would recommend to add them by opening the Info.plist file in an editor and copy-pasting the following XML snippet:

<key>SKAdNetworkItems</key>
<array>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>cstr6suwn9.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>4fzdc2evr5.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>2fnua5tdw4.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>ydx93a7ass.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>p78axxw29g.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>v72qych5uu.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>ludvb6z3bs.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>cp8zw746q7.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>3sh42y64q3.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>c6k4g5qg8m.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>s39g8k73mm.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>3qy4746246.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>hs6bdukanm.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>mlmmfzh3r3.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>v4nxqhlyqp.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>wzmmz9fp6w.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>su67r6k2v3.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>yclnxrl5pm.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>7ug5zh24hu.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>gta9lk7p23.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>vutu7akeur.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>y5ghdn5j9k.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>v9wttpbfk9.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>n38lu8286q.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>47vhws6wlr.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>kbd757ywx3.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>9t245vhmpl.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>a2p9lx4jpn.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>22mmun2rn5.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>4468km3ulz.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>2u9pt9hc89.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>8s468mfl3y.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>ppxm28t8ap.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>uw77j35x4d.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>pwa73g5rt2.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>578prtvx9j.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>4dzt52r2t5.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>tl55sbb4fm.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>e5fvkxwrpn.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>8c4e2ghe7u.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>3rd42ekr43.skadnetwork</string>
  </dict>
  <dict>
    <key>SKAdNetworkIdentifier</key>
    <string>3qcr597p9d.skadnetwork</string>
  </dict>
</array>

Otherwise, you can add them manually:

Add SKAdNetworkItems Manually

Add Ad Unit ID to your App

In the generated Xcode Project, we have created a special AdsKitExamples() view located in AdsKit/View/AdsKitExamples.swift. This contains a simple implementation of AdsBanner, which requires an ad unit ID. copy paste the ad unit ID you wrote down earlier into the adUnitID variable.

AdsKitExamples.swift
AdBanner(adUnitID: "YOUR_AD_UNIT_ID")
💡

To test the native ads implementation, you can use the test ad unit ID ca-app-pub-3940256099942544/3986624511. Remember to replace it with your own ad unit ID before submitting your app to the App Store.

Run the App

When running the app, and opening AdsKit Examples, you should see a banner ad displayed at the top of the screen.

Setting Test Device ID

If you get following error message in the console:

Test Device ID,

Then add the following line in the initGoogleMobileAds() function in `Ads.swift``

Ads.swift
public class Ads {
	public static func initGoogleMobileAds() {
		GADMobileAds.sharedInstance().start(completionHandler: nil)
        GADMobileAds.sharedInstance()
                .requestConfiguration.testDeviceIdentifiers = [ "DEVICE_TEST_ID_FROM_CONSOLE" ]
	}
}

X required SKAdNetwork identifier(s) missing from Info.plist.

That means that GoogleAdMob couldn't find all the network identifiers from your Info.plist. Make sure that you have added all the SKAdNetworkItems to your Info.plist. We try to keep the XML above updated, but here is the AdMob Documentation (opens in a new tab) that should contain all relevant network identifiers.

If this doesn't fix it, try cleaning Xcode cache or reinstalling the app. Sadly this is a common issue with GoogleAdMob.

SKAdNetwork Identifiers Missing

Account not approved yet

If you see the following message in the console:

Account not approved yet

Then your account hasn't been approved yet. This can take up to 24 hours. In the meantime, you can use the test ad unit ID.

After Release on the App Store

After your App has been released on the app store, you will be required to link your app in the Google AdMob app with your App Store listing.

In your App Settings, go to App Store Details > ADD and follow the steps there.

Link App Store Listing