Skip to content

Commit

Permalink
Merge pull request #90 from trivedigaurav/ios_uuid
Browse files Browse the repository at this point in the history
iOS UUID facade
  • Loading branch information
trivedigaurav committed Aug 10, 2014
2 parents 39fb94b + 4cac191 commit 0895e75
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Email (open mail client) X X X X X
Vibrator X
Sms (send messages) X
Compass X X X
Unique ID (IMEI or SN) X X X X X
Unique ID (IMEI or SN) X X X X X X
Gyroscope X X X
Battery X X X X X X
================================== ============= ============= === ======= === =====
17 changes: 17 additions & 0 deletions plyer/platforms/ios/uniqueid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pyobjus import autoclass
from pyobjus.dylib_manager import load_framework
from plyer.facades import UniqueID

load_framework('/System/Library/Frameworks/UIKit.framework')
UIDevice = autoclass('UIDevice')


class iOSUniqueID(UniqueID):

def _get_uid(self):
uuid = UIDevice.currentDevice().identifierForVendor.UUIDString()
return uuid.UTF8String()


def instance():
return iOSUniqueID()

0 comments on commit 0895e75

Please sign in to comment.