Playmaker Support

The plugin now contains playmaker actions.

The actions scripts can be found in the zip archive at:

Assets/Extensions/GoogleMobileAd/Addons/PlayMakerActions

You can simply unzpi it to the same folder and Google Mobile Ad actions will appear under playmaker actions menu. You always welcome on the PlayMaker Actions Forum Thread to request new actions or report a bug.

The current action list is:

GAD_InitGoogleAd

Use this action to init Google Ad.

GAD_BannerEvents

Use this action to subscribe on banner events.

Fileds:

  • Banner Id [Int32] - id of banner which you want to use.

Events:

  • On Loaded Event - fires when successfully load event.
  • On Failed To Load Event - fires when failed to load event.
  • On Open Event - fires when open banner.
  • On Close Event - fires when close banner.
  • On Left Application Event - fires when left application.

GAD_InterstitialEvents

Use this action to subscribe on interstitial events. 

Events:

  • On Loaded Event - fires when successfully loaded interstitial.
  • On Failed To Load Event - fires when failed loaded interstitial.
  • On Open Event -  fires when open interstitial.
  • On Close Event -  fires when close interstitial.
  • On Left Application Event -  fires when left application.

GAD_SetAdTargeting

Use this action to set ad targeting.

Fileds:

  • Keywords [string] - keywords for ad targeting and after fill this with keywords.
  • Day [Int32] - the day was born group of target ad.
  • Year [Int32] - a year was born group of target ad.

Checklist:

  • Gender - the gender of targeting ad.
  • Month - month was born group of target ad.

Checkbox:

  • Tag For Child Directed Trea - you can enable tag for the child.
  • Set Birthday - you can enable target ad based on date of birth.

GAD_SetAdTestDevices

Use this action to set test devices for google ad.

Fileds:

  • Devices Ids [string] - count of the test device, and after fill it with an id of test devices. 

GAD_CreateBanner

Use this action to create a banner.

Fileds:

  • Banner id [Int32] - id of the banner.
  • XCoord [Int32] - x coordinate of banner.
  • YCoord [Int32] - y coordinate of banner.

Events:

  • Success Event - fires when successfully create a banner.
  • Fail Event - fires when fail to create a banner.

Checklist:

  • Size - size and type of the banner.
  • Anchor - position of a banner.

Checkbox:

  • Create With Coord - show a banner on load or not.
  • Show Banner On Load - create banner with coord in fields.

GAD_ShowBanner

Use this action to show banner.

Fileds:

  • Banner Id [Int32] - id of a banner which you need to show.

GAD_HideBanner

Use this action to hide banner.

Fileds:

  • Banner Id [Int32] - id of the banner which you need to hide.

GAD_RefreshBanner

Use this action to refresh banner.

Fileds:

  • Banner Id [Int32] - id of the banner which you need to refresh.

GAD_DestroyBanner

Use this action to destroy banner by id.

Fileds:

  • Banner Id [Int32] - id of the banner which you need to destroy.

GAD_StartInterstisialAd

Use this action to start interstitial.

Events:

  • Success Event - fires when starting interstitial.
  • Fail Event - fires when fail to start interstitial.

GAD_LoadInterstisialAd

Use this action to load interstitial. 

Events:

  • Success Event - fires when loading interstitial.
  • Fail Event -  fires when fail to load interstitial.

GAD_ShowInterstisialAd

Use this action to show interstitial. 

Events:

  • Success Event - fires when show interstitial.
  • Fail Event -  fires when fail to show interstitial.

Implementation Guide

Make sure you read the Setup and Getting Started sections first.

With iAd you can use two types of ad interstitial and banners. But first of all you need to init google ad using the GAD_InitGoogleAd action.

1. Interstitial

There are two ways to use interstitial.

  • GAD_StartInterstisialAd action. Will start Ad load request and as soon the ad loaded will show the interstitial ad.
  • Use GAD_LoadInterstisialAd to load the Ad content. SuccessEvent will be fired if content was loaded successfully and failEvent if not. After content was successfully loaded you may use GAD_ShowInterstisialAd action to show the ad.

You should use one of those approaches every time you want to show the interstitial ad.

2. Banners

1) Create ad banner using GAD_CreateBanner action. If the banner is successfully created SuccessEvent will be fired and FailEvent if creation failed.

Do not fill the bannerId section. It will be filled after banner is created. Store this id. It will be used to control create banner with following playmaker actions 

  • GAD_HideBanner - will hide the banner
  • GAD_ShowBanner - will show the banner
  • GAD_RefreshBanner - will refresh the banner
  • GAD_DestroyBanner - will destroy the banner