{"id":6188,"library":"pyobjc-framework-videosubscriberaccount","title":"PyObjC Framework VideoSubscriberAccount","description":"pyobjc-framework-videosubscriberaccount provides Python wrappers for Apple's VideoSubscriberAccount framework on macOS. It enables Python applications to interact with TV provider authentication services and manage user subscriptions. The current version is 12.1 and it maintains an active release cadence, frequently aligning with macOS SDK updates and Python version support.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","framework","objective-c","apple","tv provider","authentication"],"install":[{"cmd":"pip install pyobjc-framework-videosubscriberaccount","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Requires Python 3.10 or newer.","package":"python","optional":false},{"reason":"This package is a wrapper for a specific macOS framework; 'pyobjc-core' provides the underlying bridge between Python and Objective-C.","package":"pyobjc-core","optional":false}],"imports":[{"note":"Imports the entire VideoSubscriberAccount framework module.","symbol":"VideoSubscriberAccount","correct":"import VideoSubscriberAccount"},{"note":"Imports a specific class from the framework.","symbol":"VSAccountManager","correct":"from VideoSubscriberAccount import VSAccountManager"}],"quickstart":{"code":"import VideoSubscriberAccount\nfrom Foundation import NSObject # NSObject is fundamental to Objective-C, often needed for PyObjC examples\n\n# The VideoSubscriberAccount framework primarily interacts with TV provider authentication\n# and subscription management, typically within a full macOS application context\n# and requires specific entitlements. This example demonstrates basic class access.\n\n# Get the shared account manager instance\nmanager = VideoSubscriberAccount.VSAccountManager.sharedAccountManager()\n\nprint(f\"VSAccountManager instance: {manager}\")\n\n# Attempting to fetch a property (e.g., current account) would typically\n# require an active application, user interaction, and entitlements.\n# For example, to get the primary account, you would usually call\n# manager.enqueueAccountMetadataRequest:completionHandler:\n# But this is often asynchronous and requires more setup than a quickstart.\n\n# A simple synchronous property if available (conceptual example, may not directly map without setup)\n# if manager.isKeyLoaded(): # Not a real method for VSAccountManager, just illustrative\n#     print(\"Account manager key is loaded.\")\n# else:\n#     print(\"Account manager key not yet loaded or not applicable in this context.\")\n\n# The framework is used to present authentication requests to the user.\n# E.g., presenting a sign-in view controller via VSAccountManager.presentViewController:.\n# This requires a running Cocoa app and is beyond a simple script quickstart.","lang":"python","description":"This quickstart demonstrates how to import the VideoSubscriberAccount framework and access its primary class, `VSAccountManager`. Due to the nature of this framework (TV provider authentication, requiring user interaction and specific application entitlements), a fully functional example within a simple Python script is not feasible. This code shows how to instantiate the `sharedAccountManager` singleton, which is the entry point for most interactions."},"warnings":[{"fix":"Upgrade your Python environment to Python 3.10 or later for PyObjC 12.x. Always check `requires_python` on PyPI or the PyObjC changelog for specific version requirements.","message":"PyObjC frequently drops support for older Python versions. PyObjC 12.0 dropped support for Python 3.9, and PyObjC 11.0 dropped Python 3.8. Ensure your Python version is compatible with the PyObjC version you are installing.","severity":"breaking","affected_versions":">=11.0"},{"fix":"Review code that interacts with object initialization, especially custom subclasses or factory methods, to ensure correct reference handling. While explicit memory management is rarely needed in Python, understanding the underlying Objective-C semantics is crucial for correct behavior.","message":"PyObjC 11.1 changed how initializer methods (those in the 'init' family) are modeled, now correctly reflecting that they 'steal' a reference to `self` and return a new one, as per clang's ARC documentation. This affects object lifecycle and reference counting.","severity":"breaking","affected_versions":">=11.1"},{"fix":"Consult Apple's Developer Documentation for the VideoSubscriberAccount framework (e.g., `developer.apple.com/documentation/videosubscriberaccount`).","message":"PyObjC framework wrappers, including `pyobjc-framework-videosubscriberaccount`, do not contain direct API documentation. Developers must refer to Apple's official VideoSubscriberAccount documentation for details on how to use the framework's classes, methods, and properties.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your macOS application is properly code-signed and configured with the necessary entitlements through Xcode for accessing TV provider accounts.","message":"The `VideoSubscriberAccount` framework is deeply integrated with macOS security features and often requires specific application entitlements to function correctly (e.g., `com.apple.developer.video-subscriber-account.request`). Without these, framework calls may fail or return no data, particularly for authentication requests.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If implementing `__new__` in a Python subclass of an Objective-C class, ensure your initialization logic is handled within `__new__` or carefully consult the PyObjC documentation for `__init__` compatibility in subsequent versions. For classes relying on PyObjC's `__new__`, `__init__` cannot be used for initialization.","message":"When subclassing Objective-C classes in Python and implementing both `__new__` and `__init__`, special care is needed. PyObjC 10.3 initially broke support for calling `__init__` when `__new__` was user-implemented, though 10.3.1 reintroduced some compatibility. Code relying on the PyObjC-provided `__new__` still cannot use `__init__` for custom initialization.","severity":"gotcha","affected_versions":">=10.3, <10.3.1 (partially fixed in 10.3.1)"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}