Giter VIP home page Giter VIP logo

Comments (6)

dbaq avatar dbaq commented on June 29, 2024

Hey @SamarRizvi,

Sorry for the response time. It looks like the plugin is not imported correctly. I never used the Intel XDK. Have you read https://software.intel.com/en-us/xdk/docs/adding-third-party-plugins-to-your-xdk-cordova-app

from cordova-plugin-contacts-phone-numbers.

SamarRizvi avatar SamarRizvi commented on June 29, 2024

Hi @dbaq ,

I have imported other plugins that are on github, they work fine. Do not understand, why your plugin doesn't work, even when Intel XDK shows your plugin as installed after build.

from cordova-plugin-contacts-phone-numbers.

dbaq avatar dbaq commented on June 29, 2024

Can you share some code? Which platform are you using?

from cordova-plugin-contacts-phone-numbers.

SamarRizvi avatar SamarRizvi commented on June 29, 2024

Sorry for replying late. I am using Intel XDK for developing html5+cordova project. About sharing code, you first have to download Intel XDK, and then create a new html5+cordova project or use a sample html5+cordova project that they have. Then include your plugin as third party plugin in your project ( read "Including Third Party Plugin" section at https://software.intel.com/en-us/xdk/docs/adding-third-party-plugins-to-your-xdk-cordova-app). Then use your example code after deviceReady. You have to build the project for a third party plugin to work and deploy the apk on your mobile phone to check if it's working. I have already repeated the above steps over and over again, but no use. Note that the cordova CLI version that I have set in Intel XDK is 4.1.2. All third party plugins work fine on mobile, but navigator.contactsPhoneNumbers always comes undefined.

from cordova-plugin-contacts-phone-numbers.

dbaq avatar dbaq commented on June 29, 2024

hey @SamarRizvi,

It is working for me when I test on my android device. You have to use the APK coming from the build, do not use their App preview:

screen shot 2015-06-29 at 5 39 49 pm

Here is my onDeviceReady function that I used in main.js:

var onDeviceReady=function(){
    alert(device.model);
    navigator.contactsPhoneNumbers.list(function(contacts) {
      alert(contacts.length + ' contacts found');
   }, function(error) {
      alert(error);
   });
   if( window.Cordova && navigator.splashscreen ) {     // Cordova API detected
        navigator.splashscreen.hide() ;                 // hide splash screen
    }
};

also in index.html, make sure to have the cordova.js imported before main.js:

<script type="text/javascript" src="cordova.js"></script>
<script src="js/main.js" type="text/javascript"></script>

phone

I am closing this issue since it is not related to this plugin. Do not hesitate to contact the XDK team if you can't figure it out what is going on.

from cordova-plugin-contacts-phone-numbers.

robertlight avatar robertlight commented on June 29, 2024

I am also getting navigator.contactsPhoneNumbers as undefined, I get "Cannot read property 'list' of undefined"

I am using phonegap and running inside of intelliJ using "serve android"

from cordova-plugin-contacts-phone-numbers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.