Registry / serialization / pyobjc-framework-adsupport

pyobjc-framework-adsupport

JSON →
library12.2pypypiunverified

PyObjC-framework-adsupport provides Python bindings for Apple's AdSupport framework on macOS. It allows Python applications to interact with native macOS APIs to obtain the advertising identifier (IDFA), which is unique to each device and primarily used for advertising purposes. The library is part of the larger PyObjC project, which regularly releases updates, with major versions typically aligning with macOS SDK changes and Python version support.

pip install pyobjc-framework-adsupport
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-A
P
pyobjc-framework-adsupport
serializationpythonv12.2
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.920 runs
build_error
glibc
py 3.103.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.
fix
Upgrade 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.
fix
Review 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.
fix
Only 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.
fix
For 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`.
fix
Ensure 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.
fix
Consult 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.
Agent activity
14 hits · last 30 days
node
10
OpenAI (training)
1
Resources
pyobjc-framework-adsupport — pip install pyobjc-framework-adsupport · libregistry