Ads SDK Integration

Integration Prerequisites

The Ads SDK is available for both Android and iOS platforms.

Android Prerequisites iOS Prerequisites
Android version 4.4 and up (API level 19+) iOS 10+
Android Build Tools 29 Xcode 12.0+
Gradle-based build system CocoaPods 1.8.4+
Build environment with Java 8  

Before you can display ads within your app, you’ll need to login to your account on Yahoo’s SSP and retrieve your Site ID, which is referenced in the integration guide below.

Configure Your Project

The Ads SDK is available via this Maven repository for Android and CocoaPods for iOS. Note that starting from Standard Edition 1.8.0, the iOS SDK will be delivered only as a collection of static frameworks via Cocoapods. This will enable apps being built via Unity to use the SDK.

Add the SDK to your project by adding the following lines to your app’s build.gradle or Podfile:

dependencies {
  implementation 'com.verizon.ads:android-vas-standard-edition:1.14.0'
  implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
  implementation 'androidx.browser:browser:1.2.0'
}
compileOptions {
  sourceCompatibility JavaVersion.VERSION_1_8
  targetCompatibility JavaVersion.VERSION_1_8
}
repositories {
  maven {
    url 'https://artifactory.verizonmedia.com/artifactory/maven/'
  }
}
platform :ios, '10.0'

target 'MyApp' do
  use_frameworks!
  project "MyApp.xcproj"
  pod 'Verizon-Ads-StandardEdition', '1.14.1'
end

[iOS Only] Enable SKAdNetwork

The Ads SDK supports attribution tracking via Apple’s SKAdNetwork framework. This allows Yahoo as well as participating third-party ad buyers to attribute app installs in the absence of the mobile device ID such as IDFA, which was removed due to the App Tracking Transparency introduced in iOS version 14.5.

Update your app’s Info.plist file and add a SKAdNetworkItems key with an additional dictionary that includes Yahoo’s SKAdnetwork ID, as well as our third-party buyers’ SKAdnetwork IDs. An up to date list of our 3rd party buyers is available here. In addition, you will also need to add your app’s App Store ID in VerizonAdsSourceAppId key. See example below.

<key>SKAdNetworkItems</key>
 <array>
	<dict>
		<key>SKAdNetworkIdentifier</key>
		<string>e5fvkxwrpn.skadnetwork</string>
	</dict>
	<dict>
		<key>SKAdNetworkIdentifier</key>
		<string>4fzdc2evr5.skadnetwork</string>
	</dict>
	<dict>
		<key>SKAdNetworkIdentifier</key>
		<string>cg4yq2srnc.skadnetwork</string>
	</dict>
	<dict>
		<key>SKAdNetworkIdentifier</key>
		<string>c6k4g5qg8m.skadnetwork</string>
	</dict>
	<dict>
		<key>SKAdNetworkIdentifier</key>
		<string>hs6bdukanm.skadnetwork</string>
	</dict>
	<dict>
		<key>SKAdNetworkIdentifier</key>
		<string>9rd848q2bz.skadnetwork</string>
	</dict>
	<dict>
		<key>SKAdNetworkIdentifier</key>
		<string>klf5c3l5u5.skadnetwork</string>
	</dict>
	<dict>
		<key>SKAdNetworkIdentifier</key>
		<string>8s468mfl3y.skadnetwork</string>
	</dict>
	<dict>
		<key>SKAdNetworkIdentifier</key>
		<string>uw77j35x4d.skadnetwork</string>
	</dict>
</array>

<key>VerizonAdsSourceAppId</key>
 	<string>Replace_this_with_your_App's_App_Store_ID</string> 

[Android Only] Android Permissions

The Ads SDK requires the INTERNET permission and includes it in the SDK’s AndroidManifest.xml. As such, you do not need to explicitly add the INTERNET permission to your AndroidManifest.xml file.

In order to report on ad requests, impressions, and clicks, the SDK also requires ACCESS_NETWORK_STATE permission. As of Standard Edition 1.5.0, this permission is included in the SDK’s AndroidManifest.xml.

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

It is recommended, but not required, that the ACCESS_FINE_LOCATION permission is also added to your AndroidManifest.xml so that Yahoo’s SSP can match your ad and bid requests to the most relevant demand.

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

Initializing the SDK

// Initialization should occur within the onCreate method of your Application subclass. Calling this method anywhere else is not supported

// Import the edition into your project
import com.verizon.ads.VASAds;

// Initialize the SDK with your Site ID
VASAds.initialize(myApp, <YOUR SITE ID>);
// Initialization should occur within the onCreate method of your Application subclass. Calling this method anywhere else is not supported

// Import the edition into your project
import com.verizon.ads.VASAds

// Initialize the SDK with your Site ID
VASAds.initialize(myApp, <YOUR SITE ID>)
// A best practice for initializing is in the app delegate’s application:didFinishLaunchingWithOptions: method

// Import the edition into your project
#import <VerizonAdsCore/VerizonAdsCore.h>

// Initialize the edition with your Site ID
[VASAds initializeWithSiteId: <YOUR_SITE_ID>];
// A best practice for initializing is in the app delegate’s application(_:didFinishLaunchingWithOptions:) method

// Initialize the edition with your site ID
VASAds.initialize(withSiteId:<YOUR_SITE_ID>)

For Android ProGuard Users

If using ProGuard to minify your app, include the following in your ProGuard config file:

-keepclassmembers class com.verizon.ads** {
public *;
}
-keep class com.verizon.ads**

Next Step

Ensure your app has the correct Privacy settings enabled. Create an Inline, Interstitial, or Native Placement.