Is there any way to fetch user's mobile number in phone gap app?
            Asked
            
        
        
            Active
            
        
            Viewed 1,753 times
        
    3 Answers
1
            
            
        There is no way you could directly use it in phonegap first you should find how to do this in each platform(ios,android,..) then with phonegap-plugins you could integrate them in your app easily. be aware that this solution is platform base tip: what you are doing is against apple legal Agreement and you will rejected from apple app store if you use that in your application .
 
    
    
        Duke
        
- 1,731
- 2
- 17
- 33
0
            
            
        https://github.com/macdonst/TelephoneNumberPlugin
I havnt tried it but i think it works for android devices
0
            
            
        Try this document
This code 100% work fine
function onDeviceReady() {
    // Now safe to use device APIs
    window.addEventListener("batterystatus", onBatteryStatus, false);
    $("#contact").click(function () {
        navigator.contacts.pickContact(function (contact) {
            console.log('The following contact has been selected:' + JSON.stringify(contact));
            $("#contact_details").html('The following contact has been selected:' + JSON.stringify(contact.phoneNumbers));
        }, function (err) {
            console.log('Error: ' + err);
        });
    });
}
 
    
    
        yathavan
        
- 183
- 1
- 14
