Add Adrop to Apple

Prerequisites

  • Install the following:

    • Xcode 14.1 or later

  • Make sure that your project meets these requirements:

    • Your project must target these platform versions or later:

      • iOS 13

      • Swift 5.0

  • Sign into Adrop using your email or Google account.


Step 1: Create an Adrop project

Before you can add Adrop to your Apple app, you need to create an Adrop project to connect to your app.

Step 2: Register your app with Adrop

To use Adrop in your Apple app, you need to register your app with your Adrop project. Registering your app is often called "adding" your app to your project.

Make sure to enter the bundle ID that your app is actually using. The bundle ID value is case-sensitive, and it cannot be changed for this Adrop Apple app after it's registered with your Adrop project.

  1. Go to the Adrop console.

  2. In the center of the project app page, click the Apple button to launch the setup workflow.

  1. Enter your app's bundle ID in the bundle ID field.

    • A bundle ID uniquely identifies an application in Apple's ecosystem.

    • Find your bundle ID: open your project in Xcode, select the top-level app in the project navigator, then select the General tab. The value of the Bundle Identifier field is the bundle ID (for example, com.yourcompany.yourproject).

    • Be aware that the bundle ID value is case-sensitive, and it cannot be changed for this Adrop app after it's registered with your Adrop project.

  2. Enter other app information: App nickname.

    • App nickname: An internal, convenience identifier that is only visible to you in the Adrop console

  3. Click Register app.

Step 3: Add an Adrop configuration file

  1. Download adrop_service.json to obtain your Adrop Apple platforms config file.

Step 4: Add Adrop SDK to your app

Use CocoaPods to install and manage Adrop dependency.

Here's how to install Adrop using CocoaPods:

  1. Create a Podfile if you don't already have one. From the root of your project directory, run the following command:

pod init
  1. To your Podfile, add the Adrop pod in your app.

pod 'adrop-ads'
  1. Install the pods, then open your .xcworkspace file to see the project in Xcode:

pod install --repo-update
open your-project.xcworkspace

Step 5: Initialize Adrop in your app

The final step is to add initialization code to your application.

  1. Import the AdropAds module in your UIApplicationDelegate

import AdropAds
// ...
  1. Initialize an Adrop shared instance in your app delegate's application(_:didFinishLaunchingWithOptions:) method:

// true for production
// If you are using this SDK in specific countries, 
// pass an array of ISO 3166 alpha-2 country codes.
Adrop.initialize(production: false, targetCountries: [])
  1. If you're using SwiftUI, you can create an application delegate and attach it to your App struct via UIApplicationDelegateAdaptor or NSApplicationDelegateAdaptor.

@main
struct YourApp: App {
  // register app delegate for Adrop setup
  @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate

  var body: some Scene {
    WindowGroup {
      NavigationView {
        ContentView()
      }
    }
  }
}

Next Steps

You're all set! Please register an Ad unit to show ads to users.

Learn how to Create your Ad unit.


(Optional) Troubleshooting

# Add this line to your Podfile
use_frameworks!

# ...
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|

        #...
        # Add this line to your Podfile
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
        end
    end
end

Last updated