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.


IMPORTANT
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 Googleskadnetworkidentifier
• Add GoogleAdsProvider.swift to your project.
• SetGoogleAdsProvider
followingSpotIm
initialization
Add the SDK
Using Cocoapods
- In a text editor, open Podfile.
- Add
pod 'SpotIMCore', '1.13.0
- Add
pod 'Google-Mobile-Ads-SDK', '8.0'
target 'OpenWeb-SDK-iOS-Demo' do
# Use one of those options
use_frameworks!
# use_frameworks! :linkage => :static
# Pods for OpenWeb-SDK-iOS-Demo
pod 'SpotIMCore', '1.13.0'
pod 'Google-Mobile-Ads-SDK', '8.0'
end
- In Terminal at the terminal prompt of your project directory, execute
pod install
to install the dependencies added to Podfile. - Open the .xcworkspace file for your project to launch Xcode.
Set Google ads SKAdNetworkIdentifier
- In the app Info.plist, add a
GADApplicationIdentifier
key with your Ad Manager app ID set as the string value, and add aSKAdNetworkItems
key withcstr6suwn9.skadnetwork
set as the value.
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-***************~**********</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
</array>
TIP
If your app cannot hold a
GADApplicationIdentifier
key, set aGADIsAdManagerApp
key.
<key>GADIsAdManagerApp</key>
<true/>
<key>SKAdNetworkItems</key>
<array>
<dict>
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
</dict>
</array>
Add GoogleAdsProvider.swift to your project
- 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.

- 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
- In Xcode, open AppDelegate.swift.
- Import the OpenWeb iOS SDK:
import SpotImCore
- Initialize the SDK in
application(application:didFinishLaunchingWithOptions)
. Be sure to replaceSPOT_ID
with your Spot ID. - Call
SpotIm.setGoogleAdsProvider
immediately afterSpotIm.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
}
Updated about 12 hours ago