Interstitial
Unity Interstitial ad unit
Before you begin!
Make sure that you have completed the Unity Plugin installation before you begin integrating the Interstitial ad unit
Integrating the Interstitial ad unit
Step 1: Initialize the Interstitial
To initialize the Interstitial, add the following line to your code:
Interstitial interstitial = new Interstitial("ADD_HERE_YOUR_PLACEMENT_ID");
Make sure to add appnext's namespace
using appnext;
Step 2: Caching (optional)
To cache an ad, use the following line:
interstitial.loadAd();
Step 3: Showing the ad
To show the ad, use the following line:
interstitial.showAd();
Step 4: Delegates (optional)**
To use delegates add the proper delegate method to the Ad:
//Get notified when the ad was loaded:
interstitial.onAdLoadedDelegate += onAdLoaded;
//Get notified when the ad was clicked:
interstitial.onAdClickedDelegate += onAdClicked
//Get notified when the ad was closed:
interstitial.onAdClosedDelegate += onAdClosed;
//Get notified when an error occurred:
interstitial.onAdErrorDelegate += onAdError;
The method signature should be:
void <name>(Ad ad){..}
The error delegate signature should be:
void <name>(Ad ad, string error){..}
Make sure to remove the delegates if you wish to stop receiving the events or when you dispose:
interstitial.onAdLoadedDelegate -= onAdLoaded;
interstitial.onAdClickedDelegate -= onAdClicked;
interstitial.onAdClosedDelegate -= onAdClosed;
interstitial.onAdErrorDelegate -= onAdError;
Step 5: Configuring the Interstitial ad unit
In order to change the interstitial configuration, call any of the following functions before showing the Interstitial:
interstitial.setButtonColor("#ffffff");
interstitial.setButtonText("Install");
interstitial.setPostback("custom_parameter");
interstitial.setCategories("example");
interstitial.setMute(false);
interstitial.setBackButtonCanClose(false); // Effects Android only
interstitial.setSkipText("Skip");
interstitial.setAutoPlay(true);
interstitial.setCreativeType(Interstitial.TYPE_MANAGED);
interstitial.setOrientation(Ad.ORIENTATION_DEFAULT);
List of configuration options:
Button Text:
The install button's text (default is "Install")
Button Color:
The install button's color - a 6 hex chars starting with # (default is "#6AB344")
Skip Button Text:
Set a custom text for the "skip" button (default is "Skip")
Category:
Set preferred ad categories
Install Postback:
Postback parameters that will be posted to your server after user installed an app (make sure to encode the values)
Can Close:
"back" key can close the interstitial (default is "false")
- true
- false
Mute Video:
Mute the video which is played in the Interstitial (default is "false"). For Interstitial, this parameter effects Android builds only.
- true
- false
Auto Play Video:
Set video auto-play (default is "true")
- true
- false
Creative Type:
Set creative type for the main section of the Interstitial (default is "Interstitial.TYPE_MANAGED")
- Interstitial.TYPE_MANAGED
- Interstitial.TYPE_VIDEO
- Interstitial.TYPE_STATIC
Orientation:
Set the preferred orientation if both landscape and portrait are supported by the application (default is ORIENTATION_DEFAULT)
- Ad.ORIENTATION_DEFAULT
- Ad.ORIENTATION_LANDSCAPE
- Ad.ORIENTATION_PORTRAIT
- Ad.ORIENTATION_AUTO
Important Note!
It is against our policies to encourage or reward the user for installing the app; we only allow rewards as a means of encouraging users to watch the video ad, so they will voluntarily install the app if they are interested.
App Categories
Android: 1. Action 2. Adventure 3. Arcade 4. Arcade & Action 5. Board 6. Books & Reference 7. Brain & Puzzle 8. Business 9. Card 10. Cards & Casino 11. Casino 12. Casual 13. Comics 14. Communications 15. Education 16. Educational 17. Entertainment 18. Family 19. Finance 20. Health & Fitness 21. Libraries & Demo 22. Lifestyle 23. Live Wallpaper 24. Media & Video 25. Medical 26. Music 27. Music & Audio 28. News & Magazines | 29. Personalization 30. Photography 31. Productivity 32. Puzzle 33. Racing 34. Role Playing 35. Shopping 36. Simulation 37. Social 38. Sports 39. Sports Games 40. Strategy 41. Tools 42. Travel & Local 43. Trivia 44. Weather 45. Word *iOS:** 1. Action 2. Adventure 3. Arcade 4. Board 5. Books 6. Business 7. Card 8. Casino 9. Catalogs 10. Dice | 11. Education 12. Educational 13. Entertainment 14. Family 15. Finance 16. Food & Drink 17. Graphics & Design 18. Health & Fitness 19. Kids 20. Lifestyle 21. Medical 22. Music 23. Navigation 24. News 25. Photo & Video 26. Productivity 27. Puzzle 28. Racing 29. Reference 30. Role Playing 31. Simulation 32. Social Networking 33. Sports 34. Strategy 35. Travel 36. Trivia 37. Utilities 38. Weather |
Make sure to encode (%20) categories with more than 1 word, example: Travel%20%26%20Local
Integration Support
Should you have any problems integrating the product, log a ticket with us by emailing [email protected]
Updated about 7 years ago