PyObjC Framework CallKit

12.1 · active · verified Tue Apr 14

PyObjC Framework CallKit provides Python wrappers for Apple's CallKit framework on macOS. It allows Python applications to interact with the system's call services, manage incoming and outgoing calls, and integrate with VoIP functionality. PyObjC frameworks typically follow the release cadence of macOS SDK updates, with frequent minor and patch releases to support new features and address compatibility.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and instantiate a core CallKit class, `CXCallController`. While the instantiation itself is functional, a complete CallKit integration requires a full macOS application with proper entitlements and event loop management. The commented section shows how you would typically initiate a call action.

import objc
from CallKit import CXCallController

# Instantiate a CallKit controller. 
# This action itself is valid, but for a CXCallController to be fully functional
# and interact with the system, it must be part of a running macOS application
# with appropriate CallKit entitlements.
controller = CXCallController.alloc().init()
print(f"Created CallKit controller instance: {controller}")
print(f"Class name: {controller.__class__.__name__}")

# In a real application, you would use this controller to create and request
# `CXTransaction` objects containing actions like `CXStartCallAction` or `CXEndCallAction`.
# Example of how you might start a call (requires full app context and entitlements):
# import uuid
# from CallKit import CXTransaction, CXStartCallAction, CXHandle
# 
# handle = CXHandle.alloc().initWithType_value_(0, "123-456-7890") # CXHandleTypePhoneNumber = 0
# call_uuid = objc.pyobjc_id(uuid.uuid4())
# start_action = CXStartCallAction.alloc().initWithCallUUID_handle_(call_uuid, handle)
# start_action.setOutgoing_connectionAddress_hasOutgoingProvider_ttyType_(
#     True, None, True, 0 # CXTTYTypeNone = 0
# )
# transaction = CXTransaction.alloc().initWithActions_([start_action])
# # controller.requestTransaction_completion_(transaction, lambda error: ...)

view raw JSON →