openCom-Companion/sbapp/plyer/platforms/ios/uniqueid.py

28 lines
570 B
Python
Raw Permalink Normal View History

2022-09-16 18:07:57 +02:00
'''
Module of iOS API for plyer.uniqueid.
'''
from pyobjus import autoclass
from pyobjus.dylib_manager import load_framework
2024-06-02 18:31:58 +02:00
from sbapp.plyer.facades import UniqueID
2022-09-16 18:07:57 +02:00
load_framework('/System/Library/Frameworks/UIKit.framework')
UIDevice = autoclass('UIDevice')
class IOSUniqueID(UniqueID):
'''
Implementation of iOS uniqueid API.
'''
def _get_uid(self):
uuid = UIDevice.currentDevice().identifierForVendor.UUIDString()
return uuid.UTF8String()
def instance():
'''
Instance for facade proxy.
'''
return IOSUniqueID()