Featured

Phonegap Contact View plugin for iPhone – Triggers Native contact view – Iphone Cordova App

December 3, 2012 by Sarath DR in Featured, Iphone Apps with 0 Comments

When we transformed one of our android application into iPhone app there was a requirement to create the phonegap contact view plugin like we have in android. The contact view plugin for phonegap android is already available in github. In the case of iPhone it is pretty much simple. Since this is my first attempt to Object C it took me around to two days to create this. Please follow the steps to install the app into your project.

Step-1: Download the plugin files and copy ContactView.h and ContactView.m to your cordova plugin folder.

Screen Shot 2012 12 03 at 15.44.41 Phonegap Contact View  plugin for iPhone   Triggers Native contact view   Iphone Cordova App

Step-2: Add the following settings in your Cordova.plist File. Right click the file and open as source code then paste the below code just above

        <key>contactView</key>
        <string>ContactView</string>

Screen Shot 2012 12 03 at 15.48.29 Phonegap Contact View  plugin for iPhone   Triggers Native contact view   Iphone Cordova App

Step-3: Please make sure that you have imported the following frameworks into your framework list

  • AddressBookUI.framework
  • AddressBook.framework

Screen Shot 2012 12 03 at 15.50.06 Phonegap Contact View  plugin for iPhone   Triggers Native contact view   Iphone Cordova App

Step – 4: You can trigger the contact view as follows from your html file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
        cordova.exec(function(result){
 
                     if( result != "" )
                     {
                     var contact = result.split("~");
 
                     if( contact.length == 2  )
                     {
 
                        var name = contact[0];
                        var phone = contact[01];
 
                         alert(name);
                         alert(phone);
                     }
 
                     }
 
                     }, function(err) {
 
 
                     }, "contactView", "showContact", ["message"]);

Download the plugin files from below

Download Plugin

github button e1355486394525 Phonegap Contact View  plugin for iPhone   Triggers Native contact view   Iphone Cordova App Git Project Link Download
PhoneGap Iphone plugin for Contact view


Share this to

Leave a reply

Your email address will not be published. Required fields are marked *

*

About
View Sarath D R's profile on LinkedIn

I am a technology consultant and an entrepreneur focused on the following technologies Java,Spring, Android, Angular, Asterisk, Symfony, Cake , Code-Igniter, Jquery , XAMPP, XHTML, AJAX, MySql, Seo, Web Design, Wordpress, iPhone development.

Today’s Tips
  • Generate Codova.jar file from Phonegap project using ant
  • Google map javascript client  to find the geographic co-ordinates  from  Address or post code
  • Update Android main UI from Webview – Phonegap Plugin
  • Jplayer is not working  with HTC One Android 4.3 version browser
  • Regular expression to validate mobile phone numbers starting with + ( plus ) – php
  • Simple pagination script for PHP
  • Useful adb ( Android Debug Bridge ) commands
  • Change the javascript files url to absolute url – Symfony 1.4
  • Set Http authentication header from Client – PHP / CURL

This site uses cookies from Google to deliver its services, to personalise ads and to analyse traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.This site also uses cookies from Google to deliver its services, to personalise ads and to analyse traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies.

Close