Type Function Return value none Revision 2017.3060 Keywords ads, advertising, Pollfish, load See also pollfish.show() pollfish.*
pollfish.load()
loads a Pollfish survey.
Once called, you can show the survey using pollfish.show(), assuming it's ready for display. You can confirm survey availability using pollfish.isLoaded().
pollfish.load( params )
Table. Table containing Pollfish survey options — see the next section for details.
The params
table includes the following parameters for the Pollfish initialization.
String. Position of the survey button. Valid values include "top"
, "center"
, and "bottom"
. Default is "bottom"
.
String. Alignment of the survey button. Valid values include "left"
and "right"
. Default is "right"
.
Number. Padding (in pixels) to adjust the vertical position of the survey button. Negative values shift the button up and positive values shift it down. 0
.
Boolean. Setting this to true
activates "custom mode" as detailed below. Default is false
.
Setting this to false
(default) is the standard way of using Pollfish in your apps. This option enables controlling behavior (intrusiveness) of the Pollfish panel in an app from the Pollfish portal. In this mode, the survey panel/button will automatically be shown according to the settings in the Pollfish dashboard.
Setting this to true
ignores the Pollfish panel behavior settings in the Pollfish portal. It always omits the Pollfish button and you must explicitly call pollfish.show() to display the loaded survey.
local pollfish = require( "plugin.pollfish" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization pollfish.load() end end -- Initialize the Pollfish plugin pollfish.init( adListener, { apiKey="YOUR_API_KEY" } )