New bug for native.showWebPopup?

It does not trigger the listener.

The bug has to be introduced in some of the latest version of Corona.

It does not work on 2189 build.

I just took the example code from the documentation:

-- Handler that gets notified when the alert closes local function onComplete( event )     print(event.action)     print(event.index)     if "clicked" == event.action then         local i = event.index         if 1 == i then                 -- Do nothing; dialog will simply dismiss         elseif 2 == i then                 -- Open URL if "Learn More" (the 2nd button) was clicked                 system.openURL( "http://www.coronalabs.com" )         end     end end -- Show alert with two buttons local alert = native.showAlert( "Corona", "Dream. Build. Ship.", { "OK", "Learn More" }, onComplete )

Added a couple of prints and it appears to be working as it should.

Copyright © 2009-2014  C o r o n a   L a b s   I n c .
2014-03-22 15:15:42.531 Corona Simulator[38466:507]     Version: 3.0.0
2014-03-22 15:15:42.531 Corona Simulator[38466:507]     Build: 2014.2189
2014-03-22 15:15:42.545 Corona Simulator[38466:507] Platform: iPhone / x86_64 / 10.9 / Intel HD Graphics 4000 OpenGL Engine / 2.1 INTEL-8.24.11
2014-03-22 15:15:42.624 Corona Simulator[38466:507] The file sandbox for this project is located at the following folder:
    (/Users/rmiracle/Library/Application Support/Corona Simulator/tmp-292D2A5488D376935C88DB31A32368A3)
2014-03-22 15:15:46.839 Corona Simulator[38466:507] clicked
2014-03-22 15:15:46.839 Corona Simulator[38466:507] 1
2014-03-22 15:16:00.894 Corona Simulator[38466:507]
Copyright © 2009-2014  C o r o n a   L a b s   I n c .
2014-03-22 15:16:00.894 Corona Simulator[38466:507]     Version: 3.0.0
2014-03-22 15:16:00.894 Corona Simulator[38466:507]     Build: 2014.2189
2014-03-22 15:16:00.909 Corona Simulator[38466:507] Platform: iPhone / x86_64 / 10.9 / Intel HD Graphics 4000 OpenGL Engine / 2.1 INTEL-8.24.11
2014-03-22 15:16:00.977 Corona Simulator[38466:507] The file sandbox for this project is located at the following folder:
    (/Users/rmiracle/Library/Application Support/Corona Simulator/tmp-292D2A5488D376935C88DB31A32368A3)
2014-03-22 15:16:08.905 Corona Simulator[38466:507] clicked
2014-03-22 15:16:08.905 Corona Simulator[38466:507] 2
 

Can you post your problem code?

Hi Rob,

thank you for trying to help.

It works on Android, does not on iOS (it did work earlier and I did not change anything in the code):

local function printHelp(url)     Global.help = nil     local function webListener( event )         local shouldLoad = true         local url = event.url                  --native.showAlert( tostring(event.errorCode), tostring(url), { OK } )                  if event.errorCode then             shouldLoad = false             isWebOpen = false             webHide()         else             isWebOpen = true             webShow()         end         return shouldLoad     end     local hh = 0          if(NoAds==true) then         hh = 80 - Global.visakY     end          local options =         {         hasBackground=false,         baseUrl=system.ResourceDirectory,         urlRequest=webListener,         autoCancel = false         }               native.showWebPopup( -visakX+1, 100, 480+2\*visakX, 620+hh, "html/" .. url .. ".html",  options ) end  

Regards,

Damir.

Are you using ads?

I found that ads (in my case inneractive) are interfering with newwebview, the same could be happening to webpopup.

Hi Luciane,

thank you for your reply.

In this case I am not using ads, but it did work even with ads.

Also, not using webview in this case, but webpopup.

Regards,

Damir.

I dont know if this is new or helps you anyhow, but event.type in the webPopUp listener is nil on my android device, when I show the webpopup and when I close it with the device back button.

This seems like a bug.

This is the same with autoCancel true and false.

Can someone file a bug report on this please?  Make sure to include your build.settings and config.lua.

Rob

I just took the example code from the documentation:

-- Handler that gets notified when the alert closes local function onComplete( event )     print(event.action)     print(event.index)     if "clicked" == event.action then         local i = event.index         if 1 == i then                 -- Do nothing; dialog will simply dismiss         elseif 2 == i then                 -- Open URL if "Learn More" (the 2nd button) was clicked                 system.openURL( "http://www.coronalabs.com" )         end     end end -- Show alert with two buttons local alert = native.showAlert( "Corona", "Dream. Build. Ship.", { "OK", "Learn More" }, onComplete )

Added a couple of prints and it appears to be working as it should.

Copyright © 2009-2014  C o r o n a   L a b s   I n c .
2014-03-22 15:15:42.531 Corona Simulator[38466:507]     Version: 3.0.0
2014-03-22 15:15:42.531 Corona Simulator[38466:507]     Build: 2014.2189
2014-03-22 15:15:42.545 Corona Simulator[38466:507] Platform: iPhone / x86_64 / 10.9 / Intel HD Graphics 4000 OpenGL Engine / 2.1 INTEL-8.24.11
2014-03-22 15:15:42.624 Corona Simulator[38466:507] The file sandbox for this project is located at the following folder:
    (/Users/rmiracle/Library/Application Support/Corona Simulator/tmp-292D2A5488D376935C88DB31A32368A3)
2014-03-22 15:15:46.839 Corona Simulator[38466:507] clicked
2014-03-22 15:15:46.839 Corona Simulator[38466:507] 1
2014-03-22 15:16:00.894 Corona Simulator[38466:507]
Copyright © 2009-2014  C o r o n a   L a b s   I n c .
2014-03-22 15:16:00.894 Corona Simulator[38466:507]     Version: 3.0.0
2014-03-22 15:16:00.894 Corona Simulator[38466:507]     Build: 2014.2189
2014-03-22 15:16:00.909 Corona Simulator[38466:507] Platform: iPhone / x86_64 / 10.9 / Intel HD Graphics 4000 OpenGL Engine / 2.1 INTEL-8.24.11
2014-03-22 15:16:00.977 Corona Simulator[38466:507] The file sandbox for this project is located at the following folder:
    (/Users/rmiracle/Library/Application Support/Corona Simulator/tmp-292D2A5488D376935C88DB31A32368A3)
2014-03-22 15:16:08.905 Corona Simulator[38466:507] clicked
2014-03-22 15:16:08.905 Corona Simulator[38466:507] 2
 

Can you post your problem code?

Hi Rob,

thank you for trying to help.

It works on Android, does not on iOS (it did work earlier and I did not change anything in the code):

local function printHelp(url)     Global.help = nil     local function webListener( event )         local shouldLoad = true         local url = event.url                  --native.showAlert( tostring(event.errorCode), tostring(url), { OK } )                  if event.errorCode then             shouldLoad = false             isWebOpen = false             webHide()         else             isWebOpen = true             webShow()         end         return shouldLoad     end     local hh = 0          if(NoAds==true) then         hh = 80 - Global.visakY     end          local options =         {         hasBackground=false,         baseUrl=system.ResourceDirectory,         urlRequest=webListener,         autoCancel = false         }               native.showWebPopup( -visakX+1, 100, 480+2\*visakX, 620+hh, "html/" .. url .. ".html",  options ) end  

Regards,

Damir.

Are you using ads?

I found that ads (in my case inneractive) are interfering with newwebview, the same could be happening to webpopup.

Hi Luciane,

thank you for your reply.

In this case I am not using ads, but it did work even with ads.

Also, not using webview in this case, but webpopup.

Regards,

Damir.

I dont know if this is new or helps you anyhow, but event.type in the webPopUp listener is nil on my android device, when I show the webpopup and when I close it with the device back button.

This seems like a bug.

This is the same with autoCancel true and false.

Can someone file a bug report on this please?  Make sure to include your build.settings and config.lua.

Rob