Add a contact to the mobile device Address book from an HTML webpage

后端 未结 4 685
时光取名叫无心
时光取名叫无心 2021-01-12 04:20

I\'m currently building a site where, with one touch, you should be able to add a contact to your IPhone/Android Address book. The website is currently HTML5, but Javascript

相关标签:
4条回答
  • 2021-01-12 04:51

    You might have to attack this from the device side of things instead. If that's what you end up doing try a cross-platform framework.

    Not sure what your flexibility is, but for cross platform device integrated application I highly recommend PhoneGap. Plus, sounds like you've got some experience in HTML5 and CSS already. This could handle your contacts integration pretty easily across devices.

    0 讨论(0)
  • 2021-01-12 04:56

    W3C defined Contacts API as a working draft but as far as I tested it's not supported in iOS devices(I have iPad with iOS4 and iPhone with iOS 5). You should test some android devices and tell us if they support Contacts API or not. That would be useful for future readers.

    In case you have contacts api supported you can do this:

    if(navigator.contacts){
       var mycontacts = [];
       navigator.contacts( ['emails.value', 'name', 'friends'],
                             function(contacts) { 
                               for(i in contacts) {
    
                                   mycontacts.push(contacts[i]);
    
                             } );
    }
    
    0 讨论(0)
  • 2021-01-12 04:59

    The first Idea i got was to use for Android (most Android-User, have a Google-Account) the Google-Contact-API.

    0 讨论(0)
  • 2021-01-12 04:59

    I'm was searching for this too, and I found only this "near" solution:

    1. Make a QR for your contact card
    2. Use a link like:
      http://qrdroid.com/decode?q=[FULL-QR-IMAGE-URL] for it
    3. If the user has QR Droid installed, it will decode the URL.

    a video here: http://www.youtube.com/watch?v=e-2D3uCV2bE

    Personally I found that solution a bit buggy, this is safer:

    1. The user saves the QR image from the browser (long-click, save image)
    2. Open the image saved
    3. Click "Menu"->Share->Decode with QR Droid

    a video here
    http://www.youtube.com/watch?v=Ws99exsZEIs

    CONS:
    it's counter intuitive
    you need android and QR droid installed
    I don't know if it's possible with iphone, and other mobiles.

    0 讨论(0)
提交回复
热议问题