Add and initialize the OpenWeb iOS SDK

To add a Conversation to your app, you must import the OpenWeb iOS SDK and then configure your project.



Starting with SpotIMCore 1.1.0, Google-Mobile-Ads-SDK is no longer included as a direct dependency. This change eliminates conflicts that occur when the Google-Mobile-Ads-SDK dependency is also a dependency of the host app.

If you previously integrated with an older version of the OpenWeb iOS SDK, you must make the following changes to upgrade to SpotIMCore 1.1.0 and support ads:

Explicitly add the Google-Mobile-Ads-SDK dependency.
Set Google skadnetworkidentifier
Add GoogleAdsProvider.swift to your project.
Set GoogleAdsProvider following SpotIm initialization

Add the SDK

Using Cocoapods

  1. In a text editor, open Podfile.
  2. Add pod 'SpotIMCore', '1.13.0
  3. Add pod 'Google-Mobile-Ads-SDK', '8.0'
target 'OpenWeb-SDK-iOS-Demo' do
  # Use one of those options
  # use_frameworks! :linkage => :static

  # Pods for OpenWeb-SDK-iOS-Demo
  pod 'SpotIMCore', '1.13.0'
  pod 'Google-Mobile-Ads-SDK', '8.0'
  1. In Terminal at the terminal prompt of your project directory, execute pod install to install the dependencies added to Podfile.
  2. Open the .xcworkspace file for your project to launch Xcode.

Set Google ads SKAdNetworkIdentifier

  1. In the app Info.plist, add a GADApplicationIdentifier key with your Ad Manager app ID set as the string value, and add a SKAdNetworkItems key with cstr6suwn9.skadnetwork set as the value.



If your app cannot hold a GADApplicationIdentifier key, set a GADIsAdManagerApp key.


Add GoogleAdsProvider.swift to your project

  1. In the Pod project, verify that GoogleAdsProvider.swift exists in the Pods/SpotIMCore/Resources folder.

    If you cannot find this file, make sure that the dependencies have been added to Podfile and installed.

  1. Copy Pods/SpotIMCore/Resources/GoogleAdsProvider.swift to your app target. If your app uses Google-Mobile-Ads-SDK version 7.69.0 and below, copy Pods/SpotIMCore/Resources/GoogleAdsV7Provider.swift to your app target.

Initialize the SDK with ads

  1. In Xcode, open AppDelegate.swift.
  2. Import the OpenWeb iOS SDK: import SpotImCore
  3. Initialize the SDK in application(application:didFinishLaunchingWithOptions). Be sure to replace SPOT_ID with your Spot ID.
  4. Call SpotIm.setGoogleAdsProvider immediately after SpotIm.initialize(spotId: spotId). Be sure that you have added GoogleAdsProvider.swift to your project.

import SpotImCore

func application(_ application: UIApplication, 
                                didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]?) -> Bool { 
    SpotIm.initialize(spotId: "SPOT_ID")
    SpotIm.setGoogleAdsProvider(googleAdsProvider: GoogleAdsProvider())
    return true

Did this page help you?