Hi all,
I’m doing something simple wrong because it’s not working. I’ve basically copy/pasted the safariView sample code, but it’s not working: native.canShowPopup( “safariView” ) returns false.
Can anyone shed some light here? To make things a bit more complicated, this link in the documentation is dead:
https://docs.coronalabs.com/plugin/CoronaProvider_native_popup_safariView/index.html
Could this link please be fixed?
For those that want to help out, I have activated the plugin, and my code is basically this in main.lua:
local function safariListener( event ) if ( event.action == "failed" ) then print( "Error loading the URL" ) elseif ( event.action == "loaded" ) then print( "Page loaded!" ) elseif ( event.action == "done" ) then print( "Safari view closed" ) end end local popupOptions = { url = "https://coronalabs.com", animated = true, entersReaderIfAvailable = true, listener = safariListener } -- Check if the Safari View is available local safariViewAvailable = native.canShowPopup( "safariView" ) print("---") print("safariViewAvailable returns:") print(safariViewAvailable) print("---") if safariViewAvailable then -- Show the Safari View native.showPopup( "safariView", popupOptions ) else print("safariView not available") end
and this in build.settings - relevant stuff at the bottom:
settings = { orientation = {default = "landscape",supported = {"landscape"},}, iphone = { plist = { UIAppFonts = {}, UIPrerenderedIcon = false, UIStatusBarHidden = true, CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", --57x57 (iPhone and iPod touch application icon) "Icon@2x.png", --114x114 (RETINA iPhone and iPod touch application icon) "Icon-iPad.png", --72x72 (iPad 1 application icon) "Icon-72.png", --72X72 (RETINA iPad 2 OLD name) "Icon-iPad@2x.png", --144x144 (RETINA iPad 3) "Icon-Small.png", --29x29 (iPhone and iPod touch Spotlight search results and Settings icon) "Icon-Small@2x.png", --58x58 (RETINA iPhone and iPod touch Spotlight search results and Settings icon) "Icon-Small-50.png", --50x50 (iPad 1 Spotlight search results and Settings icon) "Icon-Small-50@2x.png", --100x100 (RETINA iPads Spotlight search results and Settings icon) }, }, }, plugins = { ["CoronaProvider.native.popup.safariView"] = {publisherId = "com.coronalabs", supportedPlatforms = { iphone=true } }, }, }
Is there maybe a delay in the Corona website showing the plugin as activated (which it does) and the plugin really being activated and ready to use?
All help is much appreciated!
Thanks,
Thomas