Pollfish leads to app not responding

when i start my app, and come to the scene where i placed pollfish, then app gets error " unfortunately app has stopped"

Scene:

local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization pollfish.load() elseif ( event.phase == "loaded" ) then pollfish.show() end end pollfish.init( adListener, { apiKey="1710ffb1-206f-4b18-8f93-7050a16b91e4" } )

build.settings:

– For more information on build.settings see the Corona SDK Build Guide at:

http://docs.coronalabs.com/guide/distribution/buildSettings/index.html

settings =

{

plugins =

    {    

        [“plugin.applovin”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { iphone=true, android=true, appletvos=true }

        },

        – Include this for Android only

        [“plugin.coronaAds”] =

            {

                publisherId = “com.coronalabs”,

                supportedPlatforms = { iphone=true, android=true }

            },

   

        [“plugin.google.play.services”] =

            {

                publisherId = “com.coronalabs”,

                supportedPlatforms = { android=true }

            },

        [“plugin.android.support.v4”] =

            {

                publisherId = “com.coronalabs”,

                supportedPlatforms = { android=true }

            },

        [“plugin.inMobi”] =

        {

            publisherId = “com.coronalabs”

        }, 

        [“plugin.pollfish”] =

        {

            publisherId = “com.coronalabs”

        },   

       

        [“plugin.revmob”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { iphone=true, android=true }

        },

    },

orientation =

{

– Supported values for orientation:

– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

default = “portrait”,

supported = { “portrait”, }

},

excludeFiles =

{

– Include only the necessary icon files on each platform

iphone = { “Icon-*dpi.png”, },

android = { “Icon.png”, “Icon-Small-*.png”, “Icon*@2x.png”, },

},

– iOS Section

iphone =

{

plist =

{

UIStatusBarHidden = false,

UIApplicationExitsOnSuspend = false,

UIPrerenderedIcon = true, – set to false for “shine” overlay

–UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend

                   

CFBundleIconFiles =

{

“Icon.png”,

“Icon@2x.png”,

“Icon-60.png”,

“Icon-60@2x.png”,

“Icon-60@3x.png”,

“Icon-72.png”,

“Icon-72@2x.png”,

“Icon-76.png”,

“Icon-76@2x.png”,

“Icon-Small.png”,

“Icon-Small@2x.png”,

“Icon-Small@3x.png”,

“Icon-Small-40.png”,

“Icon-Small-40@2x.png”,

“Icon-Small-50.png”,

“Icon-Small-50@2x.png”,

},

–[[

– iOS app URL schemes:

CFBundleURLTypes =

{

{

CFBundleURLSchemes =

{

“fbXXXXXXXXX”,  – replace XXXXXXXXX with your Facebook appId

}

}

}

–]]

}

},

– Android Section

android =

{

usesPermissions =

{

“android.permission.INTERNET”,

            “android.permission.ACCESS_NETWORK_STATE”,

            “android.permission.WRITE_EXTERNAL_STORAGE”,

          

},

},

}

Have you tried this in a basic project, just launching the ad from main.lua?

If so, did it work OK there?  

If it works fine that way, then you may:

  • Have an issue in your scene code.
  • Have an interaction problem you’re not accounting for.

Note: If I’m reading this right you’re initializing your ads in the scene?

This is not a good idea.  I would initialize in main.lua right after launching the app.

i have changed the code :

main.lua

pollfish = require( "plugin.pollfish" ) function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization pollfish.load() end end pollfish.init( adListener, { apiKey="1710ffb1-206f-4b18-8f93-7050a16b91e4" } )

scene.lua

isSurveyLoaded = pollfish.isLoaded() if isSurveyLoaded == true then pollfish.show() end 

Still my app stops responding

Android or iOS.

What do the device logs say?

Also.  Can I suggest.  If you’re not using the plugin, don’t include it in build.settings.  You have a lot of plugins there and I am guessing not all are in use.

FYI.

Pollfish are having server issues which may lead to these problems

I’ve been in contact with Pollfish and they have informed me that they are currently working to resolve the server issues.

Thanks :slight_smile:

Have you tried this in a basic project, just launching the ad from main.lua?

If so, did it work OK there?  

If it works fine that way, then you may:

  • Have an issue in your scene code.
  • Have an interaction problem you’re not accounting for.

Note: If I’m reading this right you’re initializing your ads in the scene?

This is not a good idea.  I would initialize in main.lua right after launching the app.

i have changed the code :

main.lua

pollfish = require( "plugin.pollfish" ) function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization pollfish.load() end end pollfish.init( adListener, { apiKey="1710ffb1-206f-4b18-8f93-7050a16b91e4" } )

scene.lua

isSurveyLoaded = pollfish.isLoaded() if isSurveyLoaded == true then pollfish.show() end 

Still my app stops responding

Android or iOS.

What do the device logs say?

Also.  Can I suggest.  If you’re not using the plugin, don’t include it in build.settings.  You have a lot of plugins there and I am guessing not all are in use.

FYI.

Pollfish are having server issues which may lead to these problems

I’ve been in contact with Pollfish and they have informed me that they are currently working to resolve the server issues.

Thanks :slight_smile: