mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-01-13 16:38:08 -05:00
31 lines
926 B
JavaScript
31 lines
926 B
JavaScript
/*
|
|
* MacAddress
|
|
* Implements the javascript access to the cordova plugin for retrieving the device mac address. Returns 0 if not running on Android
|
|
* @author Olivier Brand
|
|
*/
|
|
|
|
/**
|
|
* @return the mac address class instance
|
|
*/
|
|
var MacAddress = function() {
|
|
};
|
|
|
|
/**
|
|
* Returns the mac address of the device. Return a 00:00:00:00:00:00 for
|
|
* emulator based runtime or just PC web
|
|
*
|
|
* @param successCallback
|
|
* The callback which will be called when directory listing is
|
|
* successful
|
|
* @param failureCallback
|
|
* The callback which will be called when directory listing encouters
|
|
* an error
|
|
*/
|
|
MacAddress.prototype.getMacAddress = function(successCallback, failureCallback) {
|
|
return cordova.exec(successCallback, failureCallback, 'MacAddress',
|
|
'getMacAddress', [], false);
|
|
};
|
|
|
|
cordova.addConstructor(function() {
|
|
cordova.addPlugin('macaddress', new MacAddress());
|
|
}); |