Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

pollfish - anyone?
Started by sonyayllc Jul 30 2018 07:53 AM

9 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

I see 0 posts about Pollfish - interesting.  Anyone using it?

 

I have attempted to integrate Pollfish in place of Appodeal.  Rewarded video in Appodeal does not have a paid per view option (Cost Per Completed View - CPCV), only for clicks.... Which essentially makes them no different than their other video ads... but I digress.

 

I cannot get any response from the Pollfish plugin, even in developer mode.  I may be initiating it wrong, but can't find any sample code to steal.  Here is what I have:

local function pollfishListener( event )
 
    if ( event.phase == "init" ) then  -- Successful initialization
        --pollfish.load(customMode="true")
        pollfish.load()
    elseif ( event.phase == "completed" ) then
        userdataM.save()  -- if return true, 
			  composer.gotoScene( "screenStart" )
    elseif ( event.phase == "loaded" ) then
     
    end
     
end
 
-- Initialize the Pollfish plugin
pollfish.init( pollfishListener, { apiKey="5072f1a3-e9cd-4efb-84ac-9517a615888", developerMode="true" } )


[TOPIC: post.html]
#2

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

the solution to my problem above was that developerMode="true" needs to be developerMode=true so the variable value is binary instead of a string.

 

new question though - and pollfish said that they can't help since Corona wrote the plugin.  so I am hoping to get some response here.  

 

I cannot alter the behavior of the survey button.  In the init phase, I am trying to load the survey in custom mode (which should force me to have to call the load function when I want to show the button) and in the center of the screen on the right.  I have not been able to get these options to work.  I asked Pollfish if this was a limitation of DeveloperMode, but they didn't know.  I checked the logs and nothing suspicious there...

 
local function pollfishListener( event )
 
    if ( event.phase == "init" ) then  -- Successful initialization
        pollfish.load({customMode=true,yAlign="center"})
        --pollfish.load({yAlign="center"})
	elseif ( event.phase == "completed" ) then
        userdataM.save()  -- if return true, 
		composer.gotoScene( "screenStart" )
    elseif ( event.phase == "loaded" ) then
      --pollfish.hide()
    end
     
end
 
-- Initialize the Pollfish plugin
pollfish.init( pollfishListener, { apiKey="5072f1a3-e9cd-4efb-84ac-9517a61", developerMode=true } )


[TOPIC: post.html]
#3

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

Anyone?



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,331 posts
  • Corona Staff

In the way I read the documentation, you call customMode during load and you will not get a button. You have to provide your own button that would then call .show() or call .show() after some event (such as a game over situation).

 

See:
http://docs.coronalabs.com/plugin/pollfish/load.html

 

Rob



[TOPIC: post.html]
#5

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

That is my plan and what I expect - but the button is showing always, even when customMode is true.



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,331 posts
  • Corona Staff

I'll ask our Engineering team, but it may be a while before it gets looked at.

 

Rob



[TOPIC: post.html]
#7

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

ok, thanks Rob.



[TOPIC: post.html]
#8

kakula

[GLOBAL: userInfoPane.html]
kakula
  • Enthusiast

  • 61 posts
  • Corona SDK

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



[TOPIC: post.html]
#9

sonyayllc

[GLOBAL: userInfoPane.html]
sonyayllc
  • Enthusiast

  • 96 posts
  • Corona SDK

Thank you so much. This is helping... not using it exactly as you have it, but setting a variable in the 'loaded' phase and checking it when I want to load a survey seems to be working better than checking the isLoaded() function.

 

I am still not able to totally prevent the icon from loading (so I just hide() it right away) and I cannot set the location of the icon - so it seems like the pollfish.load() is still a problem.  But I am moving on.

 

Thanks again.  I will post any progress.



[TOPIC: post.html]
#10

kakula

[GLOBAL: userInfoPane.html]
kakula
  • Enthusiast

  • 61 posts
  • Corona SDK

glad i could help :-)

 

please follow this link ... i think it will solve your remaining problems ... i had the same problems by the way... but follow instructions to resolve them

 

https://www.pollfish.com/docs/rewarded-surveys




[topic_controls]
[/topic_controls]