I'm creating a cross-platform app using Flash CS6 targeted at AIR 188.8.131.5250. I setup a StageWebView and load a URL which uses geolocation via Google's JS API.
I've ported my code from a working IOS implementation into Android. The code worked 100% fine on IOS, however, I do not get any prompts for permission to use a current location on the Android platform, and thus the map does not load or show your geolocation.
I've kept the appplication and code to a complete minimum, but I'm still banging my head against the wall to get a prompt or get the geolocation working. If you were to visit the URL below via a desktop browser or the Android's default browser, the geolocation works. When you load it via StageWebView, the map portion remains blank.
I have also set all permissions to allow for location services, etc. to no avail. Here is the barebones code that I'm running with to troubleshoot. I've even went as far as to use someone else's website in the StageWebView instance to make sure it wasn't an error within the loaded page.
webView = new StageWebView();
webView.stage = stage;
webView.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
I've gotten a bit closer to the answer, as it seems the native coding for Android has to use a work around to show the prompt as well:
Is there anyway to implement "
setWebChromeClient" via AIR?
This is how it would be done if i were coding directly for Android:
WebSettings webSettings = myWebView.getSettings();
Does anyone know of a way to do the same using StageWebView with AIR for Android?
I was initially using GPS location functionality through the actual webpage served via stagewebview, but since Android would not show the "allow location" prompt, I could never serve a location (or save it) through this method.
I had to rewrite my code to use geolocation and stored variables, then pass the information along through URL encode variables to accurately show the locations via stagewebview. I'm not sure my way is correct or not, but in a pinch it worked out pretty well. The only headache was reviewers, who had issue with the app when in a large group of people (overloaded cell towers and thus no data refresh.)
Europe, Middle East and Africa