I am using a cordova application, for the maps i let the clients download the "iframe"snippet from the backend of a website using ajax calls. I have to do this because the owner has to upload the code for the different maps. So the problem is this works like a charm on mobiles, but in samsung galaxy tab 3 and on iphone the maps are not showing. The iframe is charging but is empty. (i think the map is not rendering)
Check your error console, if it appears something like that:
ERROR Internal navigation rejected - <allow-navigation> not set for url='http://maps.google.com
Just put that on the config.xml
<allow-navigation href="*"/>
That worked for me
Related
I have a sapui5 application that works fine on Android kitkat and iOS. I have used phonegap 2.9 to run it on android and iOS. I have an app that contains all the views. On login, it goes to the home view that has a tile conatainer inside a page. Tap on tile navigates to another page. This works fine on iOS and android kitkat but the navigation does not work on android 5.0(lollipop). Remote debugging shows no error in the code. When I return tile container instead of page, it works once or twice but stops working after that.
Please help to resolve this issue.
Please follow the below steps:
Latest libraries
Avoid unnecessary files in your 'www' folder.
Change the code according to the latest version of UI5 .
I faced a similar issue and it was resolved after I followed the above mentioned steps.
we are shipping a Cordova WebApp for tablets with minified source using uglify2-compressor via grunt-contrib-requirejs. We generate source-maps for debugging which work flawlessly using the chrome desktop browser via remote Debugging on a KitKat Android Tablet.
Now we like to send error reports from our customers to our server. The Android WebView does not seem to care about our source maps. Therefore we get error message like "line 1, char 1231231" - not very helpful...
The Question is: Is it possible to use source-maps with the Android (and iOS) Webview maybe using a Cordova plugin or do we have to wait for an update (Chrome and Firefox Desktop are able to parse the maps...) and ship un-minifies code so that we are able to get the line number of the occurred error?
From Chromium discuss topic
DevTools downloads source maps using the front-end browser, not the one that runs the inspected page. So file://android... is never going to be accessible. You need to point to the files on your development box instead.
I was trying the Geolocation example from the below link.
http://docs.phonegap.com/en/1.7.0/cordova_geolocation_geolocation.md.html#Geolocation
I copied the entire content from the first 'Full Example' and saved that file as an HTML. When I opened it in Chrome (desktop) and Android phone inbuilt browser(default), I got the following three alerts on both chrome and android phone.
gap:["Device","getDeviceInfo","XXXXXXXXXX"]
gap:["NetworkStatus","getConnectionInfo","XXXXXXXXXX"]
gap:["App","show","XXXXXXXXXX"]
I clicked 'Cancel' first time and even tried 'Ok' but, nothing happens. If I click 'OK' on all three alerts on my Android Phone, the page goes all white.
So I googled it and found couple of answers on Stack Overflow suggesting:
To remove the Cordova JS file for the desktop browser
Add android specific JS from the Cordova.
So I tried both but none of them worked. Latest, I tried the following solution.
I downloaded the Cordova package (3.0.0), there was a cordova-android.zip which had the cordova.js file at the following path.
/cordova-android/framework/assets/www/cordova.js
So, now my script element looks like this:
<script type="text/javascript" charset="utf-8" src="/cordova-android/framework/assets/www/cordova.js">
After modified the <script> element as above, I don't get alerts in Chrome, but I still get following NEW alerts on my Android phone.
gap:["PluginManager","startup","Plugin ManagerXXXXXXXXXX"]
gap:["App","show","XXXXXXXXXX"]
Code: 1, message: User denied Geolocation.
So, now I have following questions:
How do I solve this problem (to run the HTML page without alert on all devices/browser)?
Any idea on why did my alerts change after changing the cordova.js file?
Regards,
Rumit
Your problem is that you're using cordova.js as if it's a JS library like jQuery, but Phonegap (Cordova) is a hybrid framework not a mobile browser framework (see here for clarification). It's not intended to be used as a standalone JS library in a webpage, but in conjunction with a native Phonegap library in order to build a native application. If you created your page as a Phonegap app and built it for Android, you would be able to (and need to) allow the app permission to use geolocation.
Phonegap apps are implemented via a native WebView and in the case of the Geolocation API, Phonegap will use only use its own implementation if the device doesn't already have a native W3C implementation (which Android does).
So the point is: either create a proper Phonegap app for Android by following the platform guide or simply don't use the Phonegap JS at all since you can call the Android browser's geolocation API (navigator.geolocation) directly from Javascript in your webpage - you don't need Phonegap's JS file to allow you to do this (have a look at the answer to this question).
I have an app built in HTML5 + PhoneGap,
in the application has a map of the Google-maps,
on an Android The application works fine,
I moved it to the iphone it also runs but it hangs when it should deal with google maps.
My link to the google map looks like this:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>
Do I need another link?
Add maps.googleapis.com to ExternalHosts in Cordova.plist. This is a whitelist of servers that the app is allowed to access.
Check the debugging log for whitelist violation errors if the problem persists, and add any other servers as necessary.
I'm developing a Sencha Touch 2 app that uses the Facebook JavaScript SDK to show a Facebook feed in a list. In my browser (localhost) it works perfect, but when I launch my app on my device (iPhone of iPad), the feed does not load. Neither when I open it via localhost in Safari on the devices.
When I use the Safari-console on my iPhone, it shows two logs which don't appear on my computer:
"JavaScript logfile at line 44: http://connect.facebook.net/en_US/all.js: Received message of type object from https://s-static.ak.facebook.com, expected a string"
Is this causing the problem? Maybe the FB-functions of the Javascript SDK don't get recognized on my device?
Can anybody help me with this? Thanks!
Where are you defining the script of fb and where is the div fb-root the defined I had the same problem before but it was because the div was always override or overwrited by another view, so check that if you can post some of the code would be better,
Do you have the fb domains added to the app url whitelist? I have had similar problem and it was solved by adding the fb domains to the access origin tag of the config file.