Registry /
serialization / pyobjc-framework-adsupport
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AdSupport
✓ import AdSupport
This is the top-level package for the AdSupport framework bindings.
This quickstart demonstrates how to access the shared instance of `ASIdentifierManager` and retrieve the `advertisingIdentifier`. It also includes a note about `App Tracking Transparency` requirements for obtaining a meaningful IDFA on modern iOS/iPadOS versions.
import AdSupport
from Foundation import NSUUID
# Note: On iOS 14.5+ and iPadOS 14.5+, your app must request
# tracking authorization using the AppTrackingTransparency framework
# (e.g., AppTrackingTransparency.ATTrackingManager.requestTrackingAuthorization_)
# before a non-zero advertisingIdentifier can be obtained.
# For macOS, AdSupport is available from 10.14+.
manager = AdSupport.ASIdentifierManager.sharedManager()
if manager.isAdvertisingTrackingEnabled():
advertising_id_nsuuid = manager.advertisingIdentifier()
# Convert NSUUID to a Python string
advertising_id_str = str(advertising_id_nsuuid.UUIDString())
print(f"Advertising ID (IDFA): {advertising_id_str}")
else:
print("Advertising tracking is disabled. Advertising ID will be all zeros.")
# The ID will be '00000000-0000-0000-0000-000000000000'
advertising_id_nsuuid = manager.advertisingIdentifier()
advertising_id_str = str(advertising_id_nsuuid.UUIDString())
print(f"Advertising ID (IDFA): {advertising_id_str}")
Debug
Known issues
breakingPyObjC has consistently dropped support for older Python versions with major releases. PyObjC 12.0 dropped Python 3.9, and PyObjC 11.0 dropped Python 3.8. Users should verify their Python version compatibility when upgrading PyObjC.fixUpgrade to a supported Python version (3.10+ for PyObjC 12.1).
affects: 11.0, 12.0
breakingVersion 11.1 aligned PyObjC's behavior with `clang`'s Automatic Reference Counting (ARC) documentation for initializer methods. This change can affect how references are managed, potentially leading to crashes if code relies on previous reference counting behavior, especially around `alloc()` and `init` methods. The `isAlloc` attribute of `objc.selector` is deprecated and will be removed in PyObjC 12.fixReview and update code to follow the new reference counting model. For object instantiation, prefer `SomeClass.alloc().init...()` or the more Pythonic `SomeClass(...)` syntax introduced in PyObjC 10.3.
affects: >=11.1
gotchaMerely referencing the `ASIdentifierManager` class (e.g., to check if the framework is linked) can cause the AdSupport framework to be linked by your application. This can lead to app rejections from Apple if your app doesn't actually use IDFA for advertising AND doesn't implement App Tracking Transparency.fixOnly import and use the AdSupport framework if your application genuinely requires the IDFA for advertising. Ensure you implement App Tracking Transparency (AppTrackingTransparency.ATTrackingManager.requestTrackingAuthorization_) for iOS/iPadOS 14.5+ if using IDFA. Consider dynamically loading the framework if only conditional checks are needed and to avoid implicit linking.
affects: All versions
gotchaInitial PyObjC 10.3 versions broke `__init__` usage when combined with PyObjC-provided `__new__` for Objective-C subclasses. While 10.3.1 partially reverted this for user-implemented `__new__`, directly calling `__init__` on `alloc()`'d objects without a user-defined `__new__` might still be problematic.fixFor Python classes subclassing Objective-C classes, ensure `__new__` and `__init__` interactions are well-defined. The recommended Pythonic way to instantiate Objective-C objects via PyObjC is `SomeClass(...)` or `SomeClass.alloc().init...()`.
affects: 10.3.x
gotchaInstallation of PyObjC, including framework wrappers, often relies on Xcode Command Line Tools being installed on macOS. Missing tools can lead to compilation errors during `pip install`.fixEnsure Xcode Command Line Tools are installed by running `xcode-select --install` in the terminal.
affects: All versions
breakingFrameworks and specific symbols can be deprecated or entirely removed as Apple updates macOS SDKs. For example, the `IMServicePlugIn` framework bindings were removed in PyObjC 10.0 because the underlying framework was removed in macOS 14.fixConsult PyObjC release notes and Apple's documentation for framework compatibility with your target macOS version. Update code to use current APIs if deprecated ones are removed.
affects: Varies by framework/symbol (e.g., 10.0 for IMServicePlugIn)
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredThis package provides the core bridge between Python and Objective-C, which is essential for all PyObjC framework wrappers to function.