无法将 PushKit 框架导入 pyobjus

Cant import a PushKit framework into pyobjus

我正在尝试从 PushKit 框架导入 UserNotifications,但我不知道如何调用它,因为我在 pyobjus 中知道的唯一包含函数是 AppKit。当我尝试从 AppKit 调用它时,我还没有看到任何从 PushKit 调用框架的方法。它 returns 一个错误。下面是我的代码和错误。我将不胜感激任何帮助。

from pyobjus import autoclass
from pyobjus.dylib_manager import load_framework, INCLUDE
load_framework(INCLUDE.AppKit)
UserNotifications = autoclass('UserNotifications')

回溯

Traceback (most recent call last):
  File "/Users/temitayoadefemi/PycharmProjects/test7/mainfile.py", line 5, in <module>
    UserNotifications = autoclass('UserNotifications')
  File "pyobjus/pyobjus.pyx", line 726, in pyobjus.autoclass
  File "pyobjus/pyobjus.pyx", line 85, in pyobjus.MetaObjcClass.__new__
  File "pyobjus/pyobjus.pyx", line 116, in pyobjus.MetaObjcClass.resolve_class
pyobjus.ObjcException: Unable to find class b'UserNotifications'

AppKit 没有名为 UserNotifications 的 class。您可以将 UNNotificationSettings 用于普通推送通知,或将 PKPushRegistry 用于 VoIP 推送通知。

参考文献:

https://developer.apple.com/documentation/pushkit?language=objc https://developer.apple.com/documentation/usernotifications?language=objc