|
| 1 | +# TelephoneNumber plugin for Phonegap # |
| 2 | + |
| 3 | +The telephone number plugin allows you to retreive the devices phone numberfrom your PhoneGap application. |
| 4 | + |
| 5 | +## Adding the Plugin to your project ## |
| 6 | + |
| 7 | +Using this plugin requires [Android PhoneGap](https://github.com/apache/incubator-cordova-android). |
| 8 | + |
| 9 | +1. To install the plugin, copy the www/telephonenumber.js file to your project's www folder and include a reference to it in your html file after cordova.js. |
| 10 | + |
| 11 | + <script type="text/javascript" charset="utf-8" src="cordova.js"></script><br/> |
| 12 | + <script type="text/javascript" charset="utf-8" src="telephonenumber.js"></script> |
| 13 | + |
| 14 | +2. Create a directory within your project called "src/com/simonmacdonald/cordova/plugins" and copy src/com/simonmacdonald/cordova/plugins/TelephoneNumber.java into it. |
| 15 | + |
| 16 | +3. In your res/xml/config.xml file add the following line: |
| 17 | + |
| 18 | + <plugin name="TelephoneNumber" value="com.simonmacdonald.cordova.plugins.TelephoneNumber"/> |
| 19 | + |
| 20 | +## Using the plugin ## |
| 21 | + |
| 22 | +You create a new object that represents the plugin using cordova.require. Then you can call the 'get' method on that object providing a success callback which will be called with a result value that is the devices phone number. |
| 23 | + |
| 24 | +<pre> |
| 25 | + /** |
| 26 | + * get the devices phone number. |
| 27 | + */ |
| 28 | + get(success, failure) |
| 29 | +</pre> |
| 30 | + |
| 31 | +Sample use: |
| 32 | + |
| 33 | + var telephoneNumber = cordova.require("cordova/plugin/telephonenumber"); |
| 34 | + telephoneNumber.get(function(result) { |
| 35 | + console.log("result = " + result); |
| 36 | + }, function() { |
| 37 | + console.log("error"); |
| 38 | + }); |
| 39 | + |
| 40 | + |
| 41 | +## RELEASE NOTES ## |
| 42 | + |
| 43 | +### December 6, 2012 ### |
| 44 | + |
| 45 | +* Initial release |
| 46 | + |
| 47 | + |
| 48 | +## BUGS AND CONTRIBUTIONS ## |
| 49 | + |
| 50 | + |
| 51 | +## LICENSE ## |
| 52 | + |
| 53 | +This plugin is available under the MIT License (2008). |
| 54 | +The text of the MIT license is reproduced below. |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +### The MIT License |
| 59 | + |
| 60 | +Copyright (c) <2012> <Simon MacDonald., et. al., > |
| 61 | + |
| 62 | + Permission is hereby granted, free of charge, to any person obtaining a copy |
| 63 | + of this software and associated documentation files (the "Software"), to deal |
| 64 | + in the Software without restriction, including without limitation the rights |
| 65 | + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 66 | + copies of the Software, and to permit persons to whom the Software is |
| 67 | + furnished to do so, subject to the following conditions: |
| 68 | + |
| 69 | + The above copyright notice and this permission notice shall be included in |
| 70 | + all copies or substantial portions of the Software. |
| 71 | + |
| 72 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 73 | + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 74 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 75 | + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 76 | + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 77 | + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 78 | + THE SOFTWARE. |
| 79 | + |
0 commit comments