# 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
To get started you must first have created:
# Getting started
# Download and Import the Frameplay Unity Plugin
To get started, download and import the Frameplay SDK.
- Download the latest version of the Frameplay plugin from the downloads page
- Open your project in the Unity editor.
- Select Assets > Import Package > Custom Package and locate the FrameplayPlugin.unitypackage file you downloaded in step 1.
- 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
- Create a FrameplayData.uasset (Frameplay Data Asset) by selecting Assets > Create > Frameplay > Data Asset
- Locate and select the newly created FrameplayData.uasset in the Project Window, under the path Assets/FrameplaySDK/Data
- In the Inspector Window set the Developer API Key and Game ID with the corresponding values found on your Game Page.
- Save the changes to the asset by File > Save Project.
# Initialize the Frameplay SDK
Loading ads at runtime requires a Frameplay session and game camera. We have provided an example script called "StartSession.cs" that includes this functionality.
- Select the Main Camera in the Hierarchy Window.
- Click Add Component in the Inspector Window and add the "StartSession.cs" script
- Add a reference to the Main Camera and FrameplayData.asset to the respective Data Asset and Camera properties. You can drag the objects from the Hierarchy and Project windows or search for them using the Object Picker.
Read more about the Frameplay Session and API here
# Create an Ad Space
Next create a Frameplay Ad Space and configure it to fit your game environment.
- Select GameObject > Frameplay > Ad Space to create a new Ad Space Game Object in the active scene.
- Pick your preferred ratio
- Reposition and scale the Ad Space to fit the Scene.
- Select your own Placeholder Material to display before an advertisement is loaded. See our Developer Guide for best practices.
The new Ad Space will display red debug text, this shows that it is not currently registered.
When creating a new Ad Space, an Activation Collider will be automatically generated. If the registered camera object overlaps with this collider the Ad Space will activate and request an advertisement.
# Register the Ad Space
For an Ad Space to request and display advertisements, it needs to be registered.
- Select the new Unregistered Ad Space Game Object from the Hierarchy or Scene Window.
- In the Inspector Window, scroll through the components list to find the Frameplay Ad Space (Script).
- Enter a description so that the Ad Space is easily identifiable on the Ad Spaces Dashboard.
- 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.
# Best Practices
We highly recommend you check out the Best Practices Guide to maximize revenue, impression quality and user experience!
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.