I am making a simple webView that shows a simple YouTube downloading site, the problem I am having is that when I click the link to download the video or mp3 nothing will happen. I have all the correct permissions I assume. I assume that I have to be missing something in the code but when I look at Corona’s documentation on network.download it is giving examples of specific links, but since YouTube will have different link every time one is generated, I can’t do that. Help would be appreciated
-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", supported = { "portrait", "landscapeRight", "landscapeLeft" } }, android = { usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.READ\_PHONE\_STATE", "android.permission.ACCESS\_WIFI\_STATE", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, }, iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, --[[-- Android permissions androidPermissions = { "android.permission.INTERNET", },]]-- }
local webView = native.newWebView( 0, 0, display.contentWidth, display.contentHeight ) webView:request( "http://www.yonverter.com/" ) webView.x = display.contentWidth \* 0.5 webView.y = display.contentHeight \* 0.5 local function webListener( event ) if event.url then print( "You are visiting: " .. event.url ) end if event.type then print( "The event.type is " .. event.type ) -- print the type of request end if event.errorCode then native.showAlert( "Error!", event.errorMessage, { "OK" } ) end end -- Called when a key event has been received. local function onKeyEvent( event ) -- Print which key was pressed down/up to the log. local message = "Key '" .. event.keyName .. "' was pressed " .. event.phase print( message ) if (system.getInfo("platformName") == "Android") then if (event.keyName == "back") and (event.phase == "down") then webView:back() return true end end -- Return false to indicate that this app is \*not\* overriding the received key. -- This lets the operating system execute its default handling of this key. return false end -- Add the key event listener. Runtime:addEventListener( "key", onKeyEvent ); webView:addEventListener( "urlRequest", webListener )