PyObjC is a bridge between Python and Objective-C, allowing Python scripts to use and extend macOS frameworks. `pyobjc-framework-storekit` provides Python wrappers for Apple's StoreKit framework, enabling developers to integrate in-app purchases and subscriptions into macOS applications written in Python. The current version is 12.1, and the project maintains an active release cadence, frequently updating bindings for new macOS SDKs and Python versions.
pip install pyobjc-framework-storekitVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import the `StoreKit` framework and begin observing payment queue transactions. Note that a fully functional StoreKit implementation requires a running macOS Cocoa application context, proper provisioning profiles, and an application distributed through the Mac App Store. The `AppHelper.runEventLoop()` call, commented out here, is essential for a complete PyObjC GUI application to process events.
Upgrade to Python 3.10 or newer, or use an older `pyobjc-framework-storekit` version compatible with your Python environment.
Review any manual reference counting logic, especially around `init` methods, to ensure it's compatible with ARC semantics.
Ensure your development environment and application distribution plan comply with Apple's requirements for StoreKit usage. Testing often involves Xcode's StoreKit Configuration files.
For classes with user-defined `__new__`, ensure `__init__` is called explicitly if needed. For classes relying on PyObjC's default `__new__`, avoid implementing `__init__` or refactor the initialization logic.
If targeting Python 3.13 with free-threading, test thoroughly and be aware that behavior might be experimental or not fully stable. Consider using standard Python threading if issues arise.