기존 UDP
기존 연동을 위해 UDP 지원을 유지합니다. 새 연동에는 WebSocket을 권장합니다.
127.0.0.1:42069로 데이터그램당 UTF-8 JSON 객체 하나를 보내세요. WebSocket 봉투로 감싸지 마세요.
import jsonimport socket
message = { "messageType": 1, "title": "Hello from UDP", "content": "An existing integration can still send notifications.", "sourceApp": "YourApp", "timeout": 5.0,}with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as connection: connection.sendto( json.dumps(message).encode("utf-8"), ("127.0.0.1", 42069), )UDP 전송은 Astral Overlay가 알림을 받거나 표시했음을 확인하지 않습니다. 아무것도 나오지 않으면 Notification API와 다른 앱의 포트 점유를 확인하세요.
공통 페이로드 문서도 참고하세요.
