i’m using pollfish for a long time … it’s good but not what i expected … and payments are quick even if they reached only 40 USD
anyway this code is working fine
first in build.settings:
plugins = { ["plugin.pollfish"] = { publisherId = "com.coronalabs" }, },
in your lua file
local pluginPollfish = require( "plugin.pollfish" ) local pollfishOptions={}
local function adPollyListener( event ) if ( event.phase == "init" ) then -- Successful initialization pluginPollfish.load({customMode=true}) elseif ( event.phase == "loaded" ) then isSurveyLoaded=true --this flag can tell your timer to show a button for users to start survey or just show the button directly depends on your code pluginPollfish.show()--this line of code shows survey elseif ( event.phase == "completed" ) then --do something like reward your user pluginPollfish.init( adPollyListener, { developerMode=false,apiKey="your api key" } ) -- initiate again for more surveys elseif ( event.phase == "closed" or event.phase == "failed" ) then pluginPollfish.init( adPollyListener, { developerMode=false,apiKey="your api key" } ) -- initiate again for more surveys end end
if tonumber(user\_Gender)==1 then pollfishOptions={ gender="male" } else pollfishOptions={ gender="female" } end pluginPollfish.init( adPollyListener, { developerMode=false,apiKey="your api key" } ) pluginPollfish.setUserDetails(pollfishOptions) -- this is claimed to provide better user experience from pollfish to send surveys for suitable --people depending on age, gender ...etc. if you had this info in your app
hope this helps