unityads

Stencyl Unity Advertising Extension (Openfl)

For Stencyl 3.4 9280 and above

Stencyl extension for “UnityAds” (http://unityads.unity3d.com) for iOS and Android. This extension allows you to easily integrate UnityAds on your Stencyl game / application. (http://www.stencyl.com)

Important!!

This Extension Required the Toolset Extension Manager https://byrobingames.github.io

unityadstoolset

Main Features

GDPR Compliance
UnityAds will automatically present users with an opportunity to opt-out of targeted advertising. See https://unityads.unity3d.com/help/legal/gdpr

It is also possible to set the consent programmatically, use the set consent to YES/NO block. (see documentation and block section)

How to Install

To install this Engine Extension, go to the toolset (byRobin Extension Mananger) in the Extension menu of your game inside Stencyl.
toolsetextensionlocation
Select the Extension from the menu and click on “Download”

If you not have byRobin Extension Mananger installed, install this first.
Go to: https://byrobingames.github.io

Documentation and Block Examples

Step 1: If you don’t have an account, create one on https://operate.dashboard.unity3d.com

Step 2: Create an project and add your platfom (iOS/Andoid)

Step 3: Open Project and get your Game id of the Platform you work with. unityadspoject

Fill your Game id in the Toolset Manager
unityadsgameid

Step 4: Use the initialize UniAds block in when created event of your first (loading)scene.
initializeUnityAds

If your game is not live yet, enable Testads in the Toolset Manager, don’t forget to disable Testads when your uploading your game to the store.
unityadstestmode

Step 5: Open the Platform you work with (iOS or Android) and get your Integration Id of the placements your added.
In this example i use iOS platform:
The Integration Id of Ad Placement Video is video
The Integration Id of Ad Placement Rewarded Video is rewardedVideo,
make sure you have enabled the Rewarded Video.

Step 6: Show Video with placement id.
Show Unityads Video with placement id block,
unityadsshowvideo

Step 7: Show Rewarded Video. Show Unityads Rewarded Video with placement id block,
Create and Alert title and Message that ask the player if he wants to watch the Rewarded Video or not. If Alert title is empty no Alert box will show.
unityadsshowrewarded

Step 8: Can Show Ads Check if ads with placement id can be show , it return true when it can show and false if ads cannot be show.
unityadscanshow

Step 9: Callbacks
unityadscallbacks
Use the callback blocks in an Updated event in an if statement.
– did show
– is completed
– is skipped (Video only, Rewarded cannot be skipped)

Show Banner with PlacementId
unityshowbanner
Show the banner, by defeault at the bottom.


Hide Banner
unityhidebanner
Hide the banner.


Move Banner
unitymovebanner
Move the banner to top or back to bottom.


Banner Callbacks
unitybannercallbacks

Button Example:

Video ad:
unityadsexamplevideobutton

Rewarded ad:
unityadsexamplerewardedbutton


Set Consent
setconsent
This block is optional for UnityAds.
But if you want to set the consent programmatically you can use this block.
YES: Yes, i agree to personalized experience.
NO: No, I do not want personalized experience.
Go to https://unityads.unity3d.com/help/legal/gdpr for more information.

Get Consent
setconsent
Return true(YES) if consent is set to YES and return false(NO) when consent is set to NO.

If you want to check if a user is in Europe, you can use the “User is in Continetn: Europe” boolean block from https://byrobingames.github.io

Version History

Submitting a Pull Request

This software is opensource.
If you want to contribute you can make a pull request

Repository: https://github.com/byrobingames/unityads

Need help with a pull request?
https://help.github.com/articles/creating-a-pull-request/

ANY ISSUES?

Add the issue on GitHub
Repository: https://github.com/byrobingames/unityads/issues

Need help with creating a issue?
https://help.github.com/articles/creating-an-issue/

paypal

Privacy Policy

http://unityads.unity3d.com

License

Author: Robin Schaafsma

The MIT License (MIT)

Copyright (c) 2014 byRobinGames http://www.byrobin.nl

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.