pythoniosxcodekivyplyer

Why do I get error TypeError: 'Swift.__StringStorage' object is not callable when using plyer.uniqueid.id?


I have a kivy app that I have been working on. It has been working fine until I try to use plyer to get the device uniqueid. In my kivy App I save it by self.device_id = plyer.uniqueid.id. It works fine when I run in Pycharm on my mac, but after building it and running it on my iphone, I get the error

app/lib/python3.11/site-packages/plyer/platforms/ios/uniqueid.py", line 19, in _get_uid
     uuid = UIDevice.currentDevice().identifierForVendor.UUIDString()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 TypeError: 'Swift.__StringStorage' object is not callable

How do I resolve this?


Solution

  • It seems that plyer's uniqueid.py file does not work on ios by default. Changing the line uuid = UIDevice.currentDevice().identifierForVendor.UUIDString() to uuid = UIDevice.currentDevice().identifierForVendor.UUIDString resolves this issue.