Phone gap 3.4 : how to navigate to native map on iOS - javascript

I developing mobile app by using Phonegap 3.4 and I would like to link my app to open a native map in the phone.
So I wrote down javascript like
function openNativeApp(latlng){
window.open('http://maps.apple.com/?q='+latlng, '_system');
}
but when i test on the app, it just open new webView and show google map in mobile version.
By this code I have done well on Phonegap 2.9 but when I try in Phonegap 3.4, it doesn't.
Any help?
Thank you

Try This code, I use in my mobile app and it works fine for me.
<a onclick="navigator.app.loadUrl('http://maps.apple.com/?q='+latlng, '_system', { openExternal:true });">Link</a>

Related

Icons and svg images display problem in ionic

I'm developing an android app using ionic, I created a new app with side menu , when i run the app icons appear in the web browser and in simulator but don't appear in the my android device (oppo A5s cph1909 with color os5.2.1) i also tried with other mobiles like samsung and other oppo it works fine .i also tried before an svg image i got a bad structured image in the android device (oppo A5s).
Any idea?

SVG not displayed with android 6 and cordova

My tablet with android 6 doesn't show svg image, there is a grey image instead. My application is made with cordova and vuejs.
I've try to launch my application with a tablette with android 7 and an other with android 9 and it's working perfectly. I think the problem is because of the android webview...
If someone has the solution of my problem or has an other opinion.
Thank you.

jQuery Ripple effect in Android

Is it possible to show water ripple effect in android using this jQuery code
I want it to run in HTC One M8 phone only. When I pulled the code from the git and hosted it in my server, the same works fine in Android webview. But adding the jQuery code to assets folder and loading it from there is not showing the effects.
Any help would be appreciated. Thank you.
Enable javascript in your webview. This could be the reason your Jquery is not working in webview.
WebView.getSettings().setJavaScriptEnabled(true);

How to enable zoom in Cordova iOS app

I have a web app I've run through Cordova/PhoneGap to create an iOS app. When I run the site on mobile Safari, zooming in and out works fine, but on the iPhone and iPad pinch to zoom doesn't work anymore.
Is there something in Cordova that would be preventing normal zooming from working?
The app uses the RaphaelJS plugin but that's all, aside from the cordova js library
you need to enable the ViewportScale in the Cordova.plist, which is set to NO by default.

Change orientation on Phonegap JQuery mobile

Hi i write simple app using jqm and phonegap, and i have some problem with change orientation. I need to change orientation on one page. I can change values "Supported interface orientations" but it work on all pages, may be exist way to change orientation on one page ?
You can use this plugin.
https://github.com/champierre/pg-plugin-screen-orientation
To lock the screen to Landscape:
navigator.screenOrientation.set('landscape');
To lock the screen to Portrait:
navigator.screenOrientation.set('portrait');
To unlock:
navigator.screenOrientation.set('fullSensor');
Here is an updated plugin which works perfectly for me: https://github.com/apache/cordova-plugin-screen-orientation
To use it (for cordova version > 4) execute this command:
cordova plugin add cordova-plugin-screen-orientation
Or for phonegap:
phonegap plugin add cordova-plugin-screen-orientation
Then use it like this:
screen.lockOrientation('portrait')
screen.lockOrientation('landscape')
Works for Android & iOS.

Categories

Resources