Snap Audience Network

Introduction

The purpose of this article is to guide publishers who want to use the Fyber FairBid SDK to load and display ads from Snap Audience Network via FairBid mediation.

Note

Snap Audience Network is still operating within Beta. If you are new to Snap Audience Network, first apply to Snap to request access. You can do so by completing this form or send an email to adkit-support@snapchat.com

 

This is a five-step process:

  1. Create or login to your Snap Account
  2. Create an app in Snap
  3. Create a placement (Slot ID) for your app
  4. Retrieve and enter the parameters from the Snap dashboard
  5. Add the Snap SDK to your integration

Note

Snap currently supports the following ad formats and for vertical display only:

  • Interstitials
  • Rewarded Videos
  • Banner

Refer to Snap for updates on supported ad formats.

Step 1: Create or Login to your Snap Account

Click here, to log in to your Snap account. In case you don't have a Snap account yet, please apply for access by filling out this form or send an email to the following address
adkit-support@snapchat.com

Step 2: Create an App in Snap

Click the appropriate link Android or iOS and follow the instructions to set-up your app in Snap.

Step 3: Create a Placement for your App

Refer to your Snap Account Manager to create a Placement (Slot ID) for your App. For any additional support, use the following email address adkit-support@snapchat.com.

Step 4: Retrieve and Enter the Parameters from the Snap Dashboard into Fyber's Dashboard

To enable Snap to work as an Ad Network on the FairBid Mediation platform, you must obtain six parameters from your Snap account and later insert them into the Fyber Console.

Set out below are the details of what parameters are required, how and where to obtain them.

Snap Parameter Description
Organization ID The unique ID of your app in the Snap system.
Client ID This is the unique identifier detailing the relationship between your account with Snap.
Client Secret Another unique identifier detailing the relationship between your account and Snap.
Refresh Token The refresh token the client application already received
Account ID The identifier of the account associated with Snap
Slot ID The identifier of the placement (slot) created on Snap's dashboard which you'll need to insert while creating instances

Alternatively, watch and listen to the video below to find out how to obtain the required parameters:

Retrieving the Snap Parameters

To obtain the required parameters from Snap:

  1. Sign-in to your Fyber account.
  2. Select your app from the App Management window.

  1. On the App Management page, click Mediated Networks.

  1. Select Snap from the list

Screen_Shot_2021-01-04_at_13.56.34.png

The Snap configuration window opens and the credentials are already entered:

Screen_Shot_2021-03-03_at_11.57.07.png

The credentials are automatically completed in the window

Screen_Shot_2021-03-03_at_11.59.39.png

  1. Click Save.
  2. To complete the setup, you must associate the network instance that you just created to the relevant Placement set up on the Fyber Dashboard. For a detailed guide click here

Step 5: Adding the Snap SDK to your Integration

To add the Snap SDK go to the Supported Networks page and follow the guide while selecting the Configuration for Snap Audience Network.

 

Notes for integrating Snap Audience Network on Android

Minimum supported API version

Warning

Snap minimum supported API version is 19

Depending on your build requirements some actions might be required

If your app's minimum supported API version is below 19, you'll see the following compilation error

Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [com.unity3d.ads:unity-ads:3.5.1] /Users/user/.gradle/caches/transforms-2/files-2.1/ead8d3090140b34c4c0a49b2c10999cf/unity-ads-3.5.1/AndroidManifest.xml as the library might be using APIs not available in 16
Suggestion: use a compatible library with a minSdk of at most 16,
or increase this project's minSdk version to at least 19,
or use tools:overrideLibrary="com.snap.adkit.distribution" to force usage (may lead to runtime failures)

If raising your applications' minimum supported version is not an option, nor is it removing Snap from your integration, we suggest the following workaround:

<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.sample">

<uses-sdk tools:overrideLibrary="com.snap.adkit.distribution"/>

This AndroidManifest will override any conflicting Manifest configuration coming from Snap with the ones defined in your application (that includes minimum supported API version).

Despite being the suggested solution (from both Fyber and Gradle ) this comes with potential side effects and should be used wisely.

Warning

When running on devices below API 19, the SDK will proactively not start Snap SDK and will therefore always return no fills. 

Ad loaded limit

Due to a limitation on Snap SDK on the current version, v1.0.3.4, it's only possible to load one ad at any given moment. If you plan on using Snap in your integration, we currently recommend disabling auto-request for any of the placements that include a Snap instance with high eCPM.

Tablets

Snap does not officially support tablets. Snap is likely to either not have ads available or have ads that are not optimized for tablets.

Permissions

Snap will remove the following permissions from your integration

  • android.permission.READ_PHONE_STATE
  • android.permission.WRITE_EXTERNAL_STORAGE
  • android.permission.READ_EXTERNAL_STORAGE

If you declare these permissions you will need to override Snaps' override

This is how you can do it:

<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:node="merge" />
<uses-permission
android:name="android.permission.READ_PHONE_STATE"
tools:node="merge" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
tools:node="merge" />

 

Snap Activity

Snap Activity does not have its own style but it does require one. Depending on how you declare the style of your application, Snap may inherit it. However, to avoid compilation issues we recommend declaring Snap's activities with a dedicated style:

<activity android:name="com.snap.adkit.external.InterstitialAdsActivity"
android:theme="@style/Theme.AppCompat.Light"/>

Note that it doesn't have to be this specific theme but it needs to be a theme declared by AppCompat.

Unity 3d and arm64 support

Warning

If you're using Unity 3d and you're building using Scripting Backend Mono (i.e., not targeting arm64 architectures), there might be a runtime exception on application start in devices with that cpu architecture.

You might see a stack trace like this:

java.lang.UnsatisfiedLinkError: No implementation found for void com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator() (tried Java_com_unity3d_player_UnityPlayer_nativeRestartActivityIndicator and Java_com_unity3d_player_UnityPlayer_nativeRestartActivityIndicator__)
at com.unity3d.player.UnityPlayer.nativeRestartActivityIndicator(Native Method)
at com.unity3d.player.UnityPlayer.resume(Unknown Source:31)
at com.fyber.fairbid.unity.testapp.debug.UnityPlayerActivity.onResume(UnityPlayerActivity.java:57)

We recommend making sure you have the following code to your gradle template:

defaultConfig {
ndk {
abiFilters **ABIFILTERS**
}
}

The exception takes place because Unity tries to access native interfaces at runtime that aren't there.

This is a side-effect of a combination of:

  • Android builds including support for all non-deprecated ABIs (Application Binary Interface) by default (starting on Unity 2018.4 the behavior is overridden and prevented)
  • Unity only supporting arm64 when using Scripting Backend IL2CPP and explicitly declaring arm64 as a target architecture
  • Snap SDK including some JNI (Java Native Interfaces) that will lead the JIT (just in time compiler) to optimize code for arm64, at runtime on arm64 devices, when full support for arm64 is not present.

The suggested solution is excluding any support for arm64 that might mislead Unity at runtime.

Note that arm64 devices still support armeabi-v7a ABI.

You can read more information about ABIs here

Back to Top ⇧