Giter VIP home page Giter VIP logo

macaddress's Introduction

NOTE: As of iOS 7, accessing the MAC address is no longer supported on iOS.

Use of the MACAddress library on iOS is not recommended except for backwards compatibility with iOS 5, will return only zeros on iOS 7, and may result in App Store rejection. It is still fine to use on Mac OS X.

Purpose

MACAddress is a simple global method that returns the MAC address for an iOS device or Mac. This is a useful way of uniquely identifying a particular device now that Apple has deprecated the uniqueIdentifier method of UIDevice.

Supported iOS & SDK Versions

  • Supported build target - iOS 5.1 / Mac OS 10.7 (Xcode 4.3.2)
  • Earliest supported deployment target - iOS 4.3 / Mac OS 10.6
  • Earliest compatible deployment target - iOS 3.0 / Mac OS 10.6

NOTE: 'Supported' means that the library has been tested with this version. 'Compatible' means that the library should work on this iOS version (i.e. it doesn't rely on any unavailable SDK features) but is no longer being tested for compatibility and may require tweaking or bug fixes to run correctly.

ARC Compatibility

MACAddress is compatible with both ARC and non-ARC compile targets.

Installation

To use MACAddress in an app, just drag the MACAddress class files into your project.

MACAddress class

The MACAddress class provides a single class function.

+ (NSString *)address;

This method returns the device's MAC address as a colon-delimited hexadecimal string in the form "00:00:00:00:00:00".

If you do not want the colons, you can specify your own delimiter using the following method. To remove the delimiter altogether, pass an empty string.

+ (NSString *)addressWithDelimiter:(NSString *)delimiter;

UIDevice class

For convenience and backwards compatibility with the 1.0 release, the MAC address is also available via the following category method on UIDevice:

- (NSString *)MACAddress;

The UIDevice class is only available on iOS.

macaddress's People

Contributors

nicklockwood avatar damiensirkis avatar

Watchers

Mo’min J.Abusaada avatar

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.