Pollfish - a poll is automatically opened after applicationResume

We are trying to use the Pollfish plugin to show polls in our app. 

For loading, we call:

pollfish.load({ customMode=true })

To make sure the red button does not appear on the screen. Instead, we have a place in our app where the user can click to complete a poll. 

However, whenever the “applicationResume” event is fired, I see the pollfish listener receives an event with phase = “loaded”, and immediately after a poll is shown (as if we called pollfish.show())

Can this be fixed? We don’t want the poll to show unless the user specifically select to complete one. 

Thanks

Hello!

You need to call Pollfish hide immediately after you initialize Pollfish in custom mode. Then when a survey is loaded you can call Pollfish show at any time a user requests it. You can read more on the abstract flow you should follow here: https://www.pollfish.com/docs/rewarded-surveys

Hope this helps.

Kind Regards

Andreas

I noticed this happens every time after a “loaded” phase, so what did the trick was to add the following code to the listener:

if event.phase == "loaded" then     pollfish.hide() end

I added pollfish.hide() immediately after the initialization, and when a callback with a “loaded” phase is received, yet this is not a good enough solution. 

On some devices, the poll is shown for a split second when the app resumes. 

I suppose it manages to draw the poll before the hide takes effect. 

If I use custom mode, is it possible to fix the plugin so it doesn’t try to show a poll when resuming the app?

Unfortunately, there’s not much we can do within the plugin.

We just initialize the Pollfish SDK according to their specifications during resume.

See reply below

@stanga

My bad. I had a look at the plugin code, and there was a possibility that the poll could show when using custom mode during resume. I’ve fixed the “onResume” issue and it’s live on the build server.

works perfectly, thanks!

Has anything changed in the plugin yesterday? 

Suddenly, the problem has returned and worsened. 

When the app resumes, a poll is shown and when we close it, the red button is suddenly visible. 

This indicates that there is code that loads a poll without setting customMode=true, and the poll is shown once it loads. 

That is very strange.

I haven’t pushed any changes to the Pollfish plugin since the 16th when I fixed the ‘custom mode’ “onResume” issue you reported.

I compiled our test app just now, and it’s behaving as expected.

Can you try to compile again and see if the issue continues? 

Hello!

You need to call Pollfish hide immediately after you initialize Pollfish in custom mode. Then when a survey is loaded you can call Pollfish show at any time a user requests it. You can read more on the abstract flow you should follow here: https://www.pollfish.com/docs/rewarded-surveys

Hope this helps.

Kind Regards

Andreas

I noticed this happens every time after a “loaded” phase, so what did the trick was to add the following code to the listener:

if event.phase == "loaded" then     pollfish.hide() end

I added pollfish.hide() immediately after the initialization, and when a callback with a “loaded” phase is received, yet this is not a good enough solution. 

On some devices, the poll is shown for a split second when the app resumes. 

I suppose it manages to draw the poll before the hide takes effect. 

If I use custom mode, is it possible to fix the plugin so it doesn’t try to show a poll when resuming the app?

Unfortunately, there’s not much we can do within the plugin.

We just initialize the Pollfish SDK according to their specifications during resume.

See reply below

@stanga

My bad. I had a look at the plugin code, and there was a possibility that the poll could show when using custom mode during resume. I’ve fixed the “onResume” issue and it’s live on the build server.

works perfectly, thanks!

Has anything changed in the plugin yesterday? 

Suddenly, the problem has returned and worsened. 

When the app resumes, a poll is shown and when we close it, the red button is suddenly visible. 

This indicates that there is code that loads a poll without setting customMode=true, and the poll is shown once it loads. 

That is very strange.

I haven’t pushed any changes to the Pollfish plugin since the 16th when I fixed the ‘custom mode’ “onResume” issue you reported.

I compiled our test app just now, and it’s behaving as expected.

Can you try to compile again and see if the issue continues?