The AppodealAds Unity Plugin helps provides a way to serve AppodealAds in a Unity project deployed as native Android or iOS applications. Plugin features include:
- Mock ad calls when running inside Unity editor
- Support for Banner Ads
- Support for Interstitial Ads
- Support for Video Ads
- Banner ad events listeners
- A sample project to demonstrate plugin integration
The plugin contains a .unitypackage file for those that want to easily import the plugin, as well as the source code for those that want to iterate on it.
- Unity 4.5
- An appKey
- To deploy on iOS:
- XCode 5.1 or above
- Appodeal-iOS-SDK.zip | check Getting Started
- 7.0.0 or higher
Please check out our AppodealAdsPlugin.unitypackage
- Open your project in the Unity editor.
- Navigate to Assets -> Import Package -> Custom Package.
- Select the AppodealAdsPlugin.unitypackage file.
- Import all of the files for the plugins by selecting Import. Make sure to check for any conflicts with files.
No pre-build setup required.
If you're running the AppodealDemo sample project, you should be able to run the project now.
To build and run on iOS, click File -> Build Settings, select the iOS platform, then Switch Platform, then Build. This will export an XCode project. You'll need to do the following before you can run it:
- From the Xcode project navigator, right-click on the project, and choose Add Files To "".
- Navigate to and select AppodealAds folder.
- Set Enable Modules (C and Objective-C) to Yes in Build Settings.
If you encounter any issues, do not hesitate to contact our happy support team at ios@appodeal.com.
The remainder of this guide assumes you are now attempting to write your own code to integrate Appodeal Ads into your game.
Here is the minimal code needed to initialize Appodeal Ads.
using AppodealAds.Api;
...
string appKey = "YOUR_APPKEY";
Appodeal appodeal = new Appodeal();
appodeal.initWithAppKey(appKey);
Here is the minimal code needed to create a banner.
using AppodealAds.Api;
...
// Create banner at the top of the screen.
BannerView bannerView = new BannerView("YOUR_APPKEY", AdPosition.TopPortrait);
// Create an empty ad request.
AODAdRequest request = new AODAdRequest();
// Load the banner with the request.
bannerView.LoadAd(request);
Here is the minimal banner code to create an interstitial.
using AppodealAds.Api;
...
// Initialize an InterstitialAd.
InterstitialAd interstitial = new InterstitialAd("YOUR_APPKEY");
// Create an empty ad request.
AODAdRequest request = new AODAdRequest();
// Load the interstitial with the request.
interstitial.LoadAd(request);
Unlike banners, interstitials need to be explicitly shown. At an appropriate
stopping point in your app, check that the interstitail is ready before
showing it:
if (interstitial.IsLoaded()) {
interstitial.Show();
}
Here is the minimal code to create an video ad.
using AppodealAds.Api;
...
// Initialize an VideoAd.
VideoAd video = new VideoAd("YOUR_APPKEY");
// Create an empty ad request.
AODAdRequest request = new AODAdRequest();
// Load the video with the request.
video.LoadAd(request);
Unlike banners, video need to be explicitly shown. At an appropriate
stopping point in your app, check that the video is ready before
showing it:
if (video.IsLoaded()) {
video.Show();
}
The following constants list the available ad positions:
AdPosition.TopPortrait
AdPosition.BottomPortrait
AdPosition.TopLandscape
AdPosition.BottomLandscape
Check out our documentation for documentation on using the SDK
To file bugs, make feature requests, or to suggest other improvements, please use github's issue tracker.
This plugin uses Google Mobile Ads Unity Plugin source code, Copyright (c) 2014 Google Inc. All Rights Reserved., under the Apache 2.0 License