My app calls a web view that is a form I want the user to complete. On the submit the PHP runs some validation and if all checks out, sends me an email.
I’ve set up the PHP redirect header so that, depending on the validation failure or success, it passes a predetermined pseudo link back to the app:
corona:invailedemail
corona:requiredfield
corona:close
In my web view listener I have this code:
[lua]local function listener( event )
if event.errorMessage == nil then
local url = event.url
if string.find( url, “corona:close” ) ~= nil then
– Close the web popup
webView:removeSelf()
native.showAlert(“Congrats again!”, “We will be in touch shortly”, {“OK”})
complete()
elseif string.find( url, “corona:invalidemail”) ~= nil then
native.showAlert(“Invaild Email”, “Please enter a vaild email address”, {“OK”})
elseif string.find( url, “corona:requiredfield”) ~= nil then
native.showAlert(“Required Field”, “All fields are required”, {“OK”})
end
end
return true
end[/lua]
It works beautifully in iOS but in Android the browser tries to open “corona:invalidemail” as a page which is course fails
I’ve tried showWebPopup and all manner of different variations but none work as perfectly for iOS and I’d really like the Android side to work the same way.
Any suggestions?