{"id":6076,"library":"pyobjc-framework-businesschat","title":"PyObjC BusinessChat Framework","description":"The `pyobjc-framework-businesschat` library provides Python wrappers for the macOS BusinessChat framework, enabling Python applications to interact with Apple Business Chat services. It is part of the broader PyObjC project, currently at version 12.1, and typically releases new versions in alignment with major macOS SDK updates.","status":"active","version":"12.1","language":"en","source_language":"en","source_url":"https://github.com/ronaldoussoren/pyobjc","tags":["macos","apple","framework","objective-c","bridge","businesschat"],"install":[{"cmd":"pip install pyobjc-framework-businesschat","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"All `pyobjc-framework-*` packages depend on `pyobjc-core` for the underlying Objective-C bridge.","package":"pyobjc-core","optional":false}],"imports":[{"symbol":"BCAuthenticationManager","correct":"from BusinessChat import BCAuthenticationManager"}],"quickstart":{"code":"import objc\nimport sys\n\nif sys.platform == 'darwin':\n    try:\n        from BusinessChat import BCAuthenticationManager\n        print(f\"BusinessChat framework imported successfully. Class: {BCAuthenticationManager}\")\n        # Check if Business Chat is supported on the current system\n        if BCAuthenticationManager.sharedAuthenticationManager().isSupported():\n            print(\"Business Chat is supported on this macOS system.\")\n        else:\n            print(\"Business Chat is NOT supported on this macOS system.\")\n    except ImportError:\n        print(\"BusinessChat framework is not available. Ensure you are on a compatible macOS version.\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")\nelse:\n    print(\"This quickstart requires macOS to run PyObjC BusinessChat framework.\")","lang":"python","description":"This example demonstrates how to import a key class from the BusinessChat framework and check if the Business Chat service is supported on the current macOS system. It includes a platform check for safe execution."},"warnings":[{"fix":"Upgrade Python to 3.10 or newer, or pin `pyobjc-framework-businesschat` to an older version compatible with your Python (e.g., `<12.0` for Python 3.9).","message":"PyObjC dropped support for Python 3.9 in version 12.0 and Python 3.8 in version 11.0. Ensure your Python environment meets the minimum requirement (currently Python 3.10+ for PyObjC 12.x).","severity":"breaking","affected_versions":"11.0, 12.0"},{"fix":"Review custom Python classes that heavily interact with Objective-C initializers, especially those overriding `__new__` or `__init__`, to ensure correct reference management. Thorough testing is recommended.","message":"PyObjC v11.1 aligned its behavior with `clang`'s Automatic Reference Counting (ARC) documentation for initializer methods. This means methods in the 'init' family now correctly steal a reference to `self` and return a new one. This could subtly change reference counting behavior in complex `__init__`/`__new__` scenarios, potentially leading to memory issues or unexpected object lifetimes.","severity":"breaking","affected_versions":"11.1 and later"},{"fix":"Ensure your application is deployed and run on macOS. If your code needs to be cross-platform, use platform checks (`sys.platform == 'darwin'`) to conditionally execute PyObjC-related code.","message":"`pyobjc-framework-businesschat` is a wrapper for a macOS-specific framework and will only function on macOS. Attempting to import or use it on other operating systems (e.g., Linux, Windows) will result in an `ImportError` or runtime errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If your Python classes using PyObjC override `__new__`, exercise caution with `__init__` and test thoroughly. Avoid calling `__init__` if `__new__` is inherited from `objc.objc_object` or another PyObjC internal mechanism.","message":"In PyObjC 10.3, the ability to use `__init__` was removed when a class or its superclasses provided a user implementation of `__new__`. While this was partially reverted in 10.3.1 to allow `__init__` when `__new__` is user-implemented, code relying on `__new__` provided by PyObjC still cannot use `__init__` as before 10.3.","severity":"gotcha","affected_versions":"10.3 (breaking), 10.3.1 and later (partial fix)"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}