Closing web popup

I’m working with a webpopup in my app and it looks great. The only issue I see is the user has to press the back button on the device to close the popup. Is there a way to make it so when the user clicks the screen and not the web popup it calls : native.cancelWebPopup()

Thanks
 

Not really.  You could put an invisible full screen button over it, and have that take your touch actions and have it close the webview.  But the user would not be able to interact with the webview.  No scrolling, no clicking on links, etc.  I usually put a close button in the corner and if you notice how apps like Facebook and Twitter work on iOS, they have a button bar at the top with a done button.

Okay I setup a transparent box around the web popup when clicked it will close the popup. New question is there a way to set a close listener on the web popup? I don’t see anything saying you can. My issue is if the user clicks the back button it will close the web popup but it won’t close my transparent box. Am I going to have to listen for the back button and check if the webview is open?

Not really.  You could put an invisible full screen button over it, and have that take your touch actions and have it close the webview.  But the user would not be able to interact with the webview.  No scrolling, no clicking on links, etc.  I usually put a close button in the corner and if you notice how apps like Facebook and Twitter work on iOS, they have a button bar at the top with a done button.

Okay I setup a transparent box around the web popup when clicked it will close the popup. New question is there a way to set a close listener on the web popup? I don’t see anything saying you can. My issue is if the user clicks the back button it will close the web popup but it won’t close my transparent box. Am I going to have to listen for the back button and check if the webview is open?