I am using JQuery Mobile with Phonegap and I am trying to create a button and when I click it a phone call should be made. I have mad a lot of research for this problem and I have found the following solution
Call
or
Call
This solution is working on browsers (is asking me to open Skype) but when I run it on Android with a Samsung Galaxy S2 is not working. It is not doing anything.
I have tried to add to the config.xml file the following permission:
<access launch-external="yes" origin="tel:*" />
but is not working either.
If you have any solution to suggest please do so. Thank you!
if you are using inappBrowser plugin, you can launch an inappbrowser window with the tel: address :
var refcall = window.open('tel:'+phoneno, '_blank', 'location=no,closebuttoncaption=Home,disallowoverscroll=yes');
you might then notice that when the call ends, you are taken back to a white screen with the tel number written on top. to avoid this, append the below code too :
refcall.addEventListener('loadstop', function(event) {
console.log('done initiating call... closing inappbrowser module');
refcall.close();
});
Try and let us know. It worked fine for me.
have you tried ?
<a rel="external" href="tel:+123456789">Call</a>
CordovaCallNumberPlugin should help you
https://github.com/rohfosho/CordovaCallNumberPlugin
add the following line to config.xml
<gap:plugin name="org.apache.cordova.inappbrowser" version="0.5.2" />
and use this command to dail the number:
window.open('tel:+123456789', '_system');
First of all, all the above answers you posted are correct and working fine. The problem I had, was that I was not including the cordova library in my app.
<script type="text/javascript" src="cordova.js"></script>
So when I have included the above line in the header of the page the phonenumber appeared on the Dial Screen! I am using the following code to create the call button:
<a rel="external" href="#" onclick="window.open('tel:+123456789', '_system');" data-role="button">Call</a>
I have tracked down the solution by creating a new phonegap app and use only the anchor tag given above. The cordova library was in the script by default.
Thank you for your answers
Related
Checking the new Ionic Capacitor Docs, there seems NO OPTION to hide the url bar of the Browser Plugin (Previously InAppBrowser) at the moment. Need help please.
According to this discussion on a GitHub Issue thread, this is not going to be possible due to the fact that both the IAB and Browser plugins use SFSafariViewController, which doesn't allow you to hide the native controls.
That said, this has been driving me crazy for a while now, as I can't hide the URL bar in either OS even when using the original IAB.
I use iframe to solve the problem
<iframe src='https://stackoverflow.com/' />
ps: url use https
So basically right now I can create a button with an A tag that has an href="tel:XXXXXXXXXXX" and if a user clicks / taps on that it will bring them into their phone application. However I am trying to do this programmatically on gesture recognition (swipe). The gesture is working, so far I have tried window.location = "tel:XXXXXXXXXX";
window.open('tel:XXXXXXXXXX', '_top');
neither of which have worked yet. Any idea? Ionic / Angular 1
Note** It appears to only happen on iOS, Android seems to be working fine.
If you want to do it through html, then you just have to place a tag like this:
Call me!
similarly if you wanna do it through javascript, you can do:
document.location.href = "tel:XXXXXXXXXX";
For this you will require to add this in the config.xml first
<access origin="tel:*" launch-external="yes" />
then call it like:
document.location.href = "tel:XXXXXXXXXX";
Whitelist Guide
You probably just can't, when your APP is running from mobile browser. You'll need to wrap your app as cordova app or similar. Then you can for example use PhoneGap-PhoneDialer
You can try with below one,
window.location.href = "tel:+91123456789";
But, for IOS it may not work because of some permission issues. In that case you can try like below,
window.open('tel:+91123456789', '_system');
Try it on a real device.
None of these methods worked on the IOS emulator. It only worked on a physical device. That tripped me up for a while.
I'm working on an APP that consist of HTML and CSS using the Cordova framework.
There is a button that should open a webpage. The problem is that it opens the webpage inside of the app instead of safari.
My knowledge of Objective C is extremely limited (none) so I was hoping there would be a solution using maybe Javascript.
I've looked all over the internet but couldn't find a non-Objective C solution.
The button is pretty straightforward: <img src="img/button.jpg" alt="website">
I thought target="_blank" might do something for me but that (unsurprisingly) didn't work.
You can use inappbrowser plugin
http://cordova.apache.org/docs/en/3.3.0/cordova_inappbrowser_inappbrowser.md.html#InAppBrowser
Detect click on link using javascript or jquery and use this following code
window.open('http://www.google.com', '_system', 'location=yes');
I found the answer to my problem:
Opening all URL's with Cordova childbrowser
Only problem is that it automatically opens twitter.com because of the share button for some unknown reason. I'm guessing this is because of an api call it's performing upon being loaded.
I am trying to open a link into an external browser with phone gap 3.3.0 but i am having no luck. I added the plugin to the config file and phone gap is in the index.html file as well so i know those have loaded. I have an anchor that calls
openURL(url) which then calls the following function.
function openURL(urlString){
var myUrl = encodeURI(urlString);
window.open(myUrl,'_system');
}
as far as i can tell i have done everything right that is said in the documentation but it still will not load in safari on the iOS. I am testing on a iPad mini running IOS 7 but i have also tested it on android and i get the same issue.
Thanks in advance for any help you can provide.
Update
So I ended up bootstrapping angular which seems to have done something but when i open a link it appears without a toolbar
Have you seen this question? http://community.phonegap.com/nitobi/topics/pgb_3_3_open_link_in_external_system_browser_not_working_in_ios?rfm=1
need to add:
<gap:plugin name="org.apache.cordova.inappbrowser" /> in config.xml
<script src="phonegap.js<>/script> in your index.html (in head)
open link via:
Test 6 manipulate html or:
window.open("http://www.google.de","_system");
Can you use a script on your page with the "bookmark us" url on a smartphone? I know Chrome doesn't support this function but i was wondering if there is a way to get it working on an iphone?
Cheers,
Toby
As far as I know, there is unfortunately no way to do this in code on iOS.
The suggested route is to prompt the user to add your website as a bookmark.
To do this, there is a neat little JS library: mobile-bookmark-bubble.