# Quick Start

This guide will show you how to integrate the Frameplay plugin into your Unity project.

We officially support:

  • Unity 2018.4 or higher
  • PC, OSX, iOS, Android and WebGL platforms

# Prerequisites

To get started you must first have created:

# Getting started

# Download and Import Frameplay's Unity Plugin

To get started, lets download and import the Frameplay SDK.

  1. Download the latest version of the Frameplay plugin from the downloads page
  2. Open your project in the Unity editor.
  3. Select Assets > Import Package > Custom Package and locate the FrameplayPlugin.unitypackage file you downloaded in step 1.
  4. Make sure all files are selected and click Import.


# Setup the Frameplay Data Asset

The Frameplay Data Asset is a Scriptable Object and used to maintain the link between your Unity project and the Frameplay Developer Dashboard. It requires a Game ID and API Key which are given to you when creating a game on Frameplay's Game Page

  1. Create a FrameplayData.uasset (Frameplay Data Asset) by selecting Assets > Create > Frameplay > Data Asset
  2. Locate and select the newly created FrameplayData.uasset in the Project Window, under the path Assets/FrameplaySDK/Data
  3. In the Inspector Window set the Developer API Key and Game ID with the corresponding values found on your Game Page.
  4. Save the changes to the asset by File > Save Project.


# Initialize Frameplay SDK

Before loading ads--during runtime--you need to do two things:

We have provided a "StartSession.cs" example script to do this for you and make set up quick an easy. The script is very simple and worth checking out! More information on Frameplay's public API.

  1. Select any Game Object in the Hierarchy Window, we chose the Main Camera.
  2. Click Add Component in the Inspector Window, search for and add the "Start Session" script
  3. Once added, create a reference to the Main Camera and FrameplayData.uasset to the respective Data Asset and Camera public properties. Do this by either dragging the objects--from the Hierarchy and Project windows--into their respective slots, or, by searching for them (click the little circle to the right of the slot).


See the Unity manual for more information on GameObjects Scripts and Cameras.

# Create an Ad Space

Next, create a Frameplay Ad Space. Put simply, this is a one sided billboard that display ads within you environment/scene. Note that there is a limit of 20 concurrent active Ad Spaces at runtime.

  1. Select GameObject > Frameplay > Ad Space to create a new Ad Space Game Object in the active scene.
  2. Position the newly created Ad Space in your scene.

The new unregistered Ad Space will display red debug text. Creating a new Ad Space will also automatically generate a new Activation Collider. This is used at runtime. If your registered camera--registered in previous section--overlaps this collider the Ad Space will activate and request an advertisement (assuming the ad space is registered).

ImageImage Image

# Register the Ad Space

For an Ad Space to request and display advertisements, it needs to first be registered. Please note, once an Ad Space has been registered, it cannot be unregistered. It can however be modified by using the Replace Ad Space button inside the Inspector Window.

Previous versions of a modified Ad Space will remain on the Ad Spaces Dashboard. This ensures Ad Spaces from previous build versions will receive metrics and generate revenue.

  1. Select the newly created Unregistered Ad Space Game Object from the Hierarchy or Scene Window.
  2. In the Inspector Window, scroll through the components listed to find the Frameplay Ad Space (Script).
  3. Enter a description so that the Ad Space is easily identifiable on the Ad Spaces Dashboard.
  4. Pick your preferred ratio, reposition and scale the Ad Space in the scene to your liking.
  5. Click the Register Ad Space button.

The debug text will change from red to white as the Ad Space is now registered and linked to the Frameplay servers. When activated it will download mock advertisements.

Ad Spaces cannot be registered at runtime.


# Load Mock Ads

Click Play. This will trigger the Frameplay session to start and a mock advertisement to load.


Congratulations! You have created your first intrinsic advertisement.

# Publishing Builds

# Development Build

When playing in Editor and Development Builds, mock advertisements will be loaded at runtime.

To create a build select File > Build Settings and toggle Development Build on while in development.


# Release Build

Before monetizing your release build, you must first submit your account and game for approval on the Frameplay Platform:

The current wait time for game approval is 48 hours. No advertisements will load in non-development builds until both your account and game is approved.

When you are ready to build a production version of your project, set Test Mode off, in the Frameplay Data Asset. Ad Spaces will now request and load real revenue raising advertisements.


See the Unity manual for more information on Publishing Builds.

# Best Practices

We highly recommend you check out the Best Practices Guide to maximize revenue, impression quality and user experience!

# Troubleshooting

If something went wrong during setup, check the Console Window for warnings (Ctrl+Shift+C on Windows, or Shift+Command+C for Mac) or visit our FAQ page.

# Mac Users

Mac users may receive the following message: "stb_image.dylib can't be opened because Apple cannot check it for malicious software"

This is a precompiled image decoding library that processes JPG's and PNG's asynchronously.

To fix this, select "Allow Anyway" the in Security & Privacy settings for the file stb_image.dylib.


Last Updated: 6/9/2020, 5:49:53 AM