| 1 | ''' |
| 2 | Module of iOS API for plyer.uniqueid. |
| 3 | ''' |
| 4 | |
| 5 | from pyobjus import autoclass |
| 6 | from pyobjus.dylib_manager import load_framework |
| 7 | from plyer.facades import UniqueID |
| 8 | |
| 9 | load_framework('/System/Library/Frameworks/UIKit.framework') |
| 10 | UIDevice = autoclass('UIDevice') |
| 11 | |
| 12 | |
| 13 | class IOSUniqueID(UniqueID): |
| 14 | ''' |
| 15 | Implementation of iOS uniqueid API. |
| 16 | ''' |
| 17 | |
| 18 | def _get_uid(self): |
| 19 | uuid = UIDevice.currentDevice().identifierForVendor.UUIDString() |
| 20 | return uuid.UTF8String() |
| 21 | |
| 22 | |
| 23 | def instance(): |
| 24 | ''' |
| 25 | Instance for facade proxy. |
| 26 | ''' |
| 27 | return IOSUniqueID() |