mergBanner

mergBanner is a LiveCode external that adds an iAd banner to your app at the bottom of the screen.

mergBanner Syntax

command mergBannerCreate

Syntax example:

on openStack
  if the environment = "mobile" then
      mobileSetAllowedOrientations "portrait,portrait upside down,landscape left,landscape right"
      -- must be after the stack is fully visible
      send mergBannerCreate to me in 100 milliseconds
  end if
end openStack

Creates the banner off screen.

command mergBannerDelete

Syntax example:

on closeStack
  -- you should also delete and recreate if you don't want to sisplay the banner for a long time
  mergBannerDelete
end closeStack

Deletes the bannser and removes from screen if it’s currently being displayed.

command mergBannerVisible pBoolean

Syntax example:

on mergBannerLoaded
  -- an add has loaded so you can display the banner now
  mergBannerVisible true
end mergBannerLoaded
 
on mergBannerError
  -- hide the banner because an add failed to load
  mergBannerVisible false
end mergBannerError

Animates the banner on and off screen.

function mergBannerRect()

Syntax example:

put mergBannerRect() into tRect

Returns:

  • Returns the rect of the banner so you can resize your UI above it.

message mergBannerLoaded

Syntax example:

on mergBannerLoaded
  -- an add has loaded so you can display the banner now
  mergBannerVisible true
end mergBannerLoaded

Sent to the default card when an add is loaded. You should not set the banner to visible until you recieve this message.

message mergBannerError

Syntax example:

on mergBannerError
  -- hide the banner because an ad failed to load
  mergBannerVisible false
end mergBannerError

Sent to the default card when an add failed to load.

message mergBannerActionStarted pLeavingApp

Syntax example:

on mergBannerActionStarted pLeavingApp
  -- full screen banner action
  -- stop doing stuff that consumes lots of memory etc
end mergBannerActionStarted

Sent to the default card when a user clicks on an ad.

message mergBannerError

Syntax example:

on mergBannerActionFinished
  -- back to your app so
  -- start doing your thing again
end mergBannerActionFinished

Sent to the default card when the user closes the full screen ad.