Before you start, note that we support Unity version 2018.4 and up.
After you’ve downloaded the SDK from our website, add Sayollo’s SDK to your project in the Assets folder. A window of the package import will pop. Click “All” and then click “Import”.
Please follow the next steps:
Overview
Sayollo Ad Player allows you to easily embed video ads with your Unity 3D game. This document describes the integration of Sayollo Unity Ad Player with your product.
Prerequisites
Sayollo Ad Player currently supports Unity v2018.4.14f1 LTS and above with .NET Standard 2.0 support. At the moment the recommended unity version is 2019.3.7f1; for older versions of unity see the Unity Older Versions Notes section at the end of this document.
Download
Download the SDK at https://gitlab.com/sayollo/Unity3D-SDK Please note – you may download the latest version directly from the master or choose to download a specific tag.
Integration
Enable .NET Standard 2.0
Open Project Settings and see the following configuration: (Edit>Project Settings>Player>Other Settings>Configuration)
3. In the Prefabs folder, you will find a Video Player prefab you should import to your game.
4. Drag & Drop the VideoPlayer from the Prefabs into the game scene to create a new GameObject called VideoPlayer.
5. The GameObject can be scaled and moved. We recommend keeping an aspect ratio of 16:9 in order for ads to be displayed appropriately.
6. You are ready to play ads! 🙂
Sayollo Events:
To use the Sayollo events you first need to add the next using statement:
using SayolloPlayer;
● Ads status event
This event will trigger every time there will be a change in the SDK ads state, and provides the developer the option to track on 2 given states:
These Events will allow you to decide what to do with the Player when there are no ads to play. Since we don’t want to remove the Player element for you since it may be an integral part of the game’s design, we have allowed you to decide whether you want to show it when there are no ads. If no ads exist, we will show a default video of your choice.
In order to register a method that will trigger when the state is changed, you will need to add the following line to your code:
SayolloEvents.RegisterAdsStatusEventAsync(MyFunctionAdsState);
“MyFunctionAdsState” method signature should look like this:
Task MyFunctionAdsState(AdsStatus adsStatus){ … }
● SDK Status event
This Event will trigger every time the game start, and provides the developer the option to track on 2 given SDK states:
Again, you can choose what to do when the SDK is inactive and remove the player completely. The SDK may be inactive due to settings (for example, the player has a very old OS you don’t want us to support).
In order to register a method that will trigger when the state is change you will need to add the following line to your code:
SayolloEvents.RegisterSdkStatusEventAsync(MyFunctionSdkState);
“MyFunctionSdkState” method signature should look like this :
Task MyFunctionSdkState(SDKStatus sdkStatus){ … }
Do’s and Don’ts
material or texture area on other game objects, it may cause unexpected
behavior.
experience.
GDPR & CCPA
In order to config GDPR & CCPA settings, it is required to send the following values to the SDK, as part of the implementation in the game’s code:
a. GDPRConsent.UserAcceptConsent – this parameter is used to indicate whether the user accepts a GDPR consent or not as part of the game’s Terms & Condition.
b. CCPAOptOut.UserRequestOptOut – (bool ExpliciteNotice, bool OptOutSale, bool LSPA). ** For more info regarding CCPA please refer to the iab documentation
Example:
using UnityEngine; using SayolloPlayer;
public class config : MonoBehaviour {
void Start() {
GDPRConsent.UserAcceptConsent = true;
CCPAOptOut.UserRequestOptOut = (true, false, null);
}
Troubleshoot Android
Ads don’t return after a build is completed: Go to Edit > Project Settings
Player -> Other Settings (android) -> Configuration -> Internet Access.
Change the value to “Require”
iOS
Run time error received after build: “Thread 1: EXC_BAD_ACCESS” Go to Project Settings -> Player -> Other Settings (ios) -> Optimization -> Strip Engine Code.
Uncheck “Strip Engine Code”
Unity Older Versions Notes
In order to support older version of unity (2018.4.14f1 and above) it is necessary to update the “Import Settings” of a few files in the SDK folder:
a. SayolloSDK/Scripts/SayolloEditorScripts.dll Select only the “Editor” checkbox in the “Include Platforms” section
b. SayolloSDK/Plugins/Android/UnityWebView.dll
SayolloSDK/Plugins/Android/UniWebView.aar
for both Android files in the “Android” folder select “Any Platforms” and in “Exclude Platforms” box select “iOS”.
C. SayolloSDK/Plugins/iOS/UnityWebView.dll SayolloSDK/Plugins/iOS/libUniWebView.a
For the iOS files in the “iOS” folder choose only “iOS” in the “Include Platforms” section.
Powered by BetterDocs