Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS UUID facade #90

Merged
merged 1 commit into from
Aug 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()