SDK 이벤트(Python)
마지막 업데이트: 2024년 7월 20일
- 주제:
- APIs/SDKs
작성 대상:
- 개발자
설명
SDK를 초기화할 때 options["events"]
dict는 이벤트 이름 키와 콜백 함수 값이 있는 선택적 개체입니다. SDK 내에서 발생하는 다양한 이벤트를 구독하는 데 사용할 수 있습니다. 예를 들어 client_ready
이벤트는 SDK에서 메서드 호출을 수행할 준비가 되었을 때 호출되는 콜백 함수와 함께 사용할 수 있습니다.
callback
함수가 호출되면 이벤트 개체가 전달됩니다. 각 이벤트에는 이벤트 이름에 해당하는 type
이(가) 있으며, 일부 이벤트에는 관련 정보가 있는 추가 속성이 포함되어 있습니다.
이벤트
이벤트 이름(유형) | 설명 | 추가 이벤트 속성 |
---|---|---|
client_ready | 아티팩트가 다운로드되고 SDK가 get_offers 호출을 위해 준비되면 내보내집니다. 사용 시 권장 | 온디바이스 의사 결정 방법. |
artifact_download_succeeded | 새 아티팩트가 다운로드될 때마다 내보내집니다. | artifact_payload, artifact_location |
artifact_download_failed | 아티팩트가 다운로드되지 않을 때마다 내보내집니다. | artifact_location, 오류 |
예
Python
def client_ready_callback():
# make get_offers requests
def artifact_download_succeeded(event):
print("The artifact was successfully downloaded from {}".format(event.artifact_location))
# optionally do something with event.artifact_payload, like persist it
def artifact_download_failed(event):
print("The artifact failed to download from {} with the following error: {}"
.format(event.artifact_location, str(event.error)))
client_options = {
"client": "acmeclient",
"organization_id": "1234567890@AdobeOrg",
"events": {
"client_ready": client_ready_callback,
"artifact_download_succeeded": artifact_download_succeeded,
"artifact_download_failed": artifact_download_failed
}
}
target_client = target_client.create(client_options)
Target
- Adobe Target 개발자 안내서
- 시작
- 클라이언트측 구현
- 개요: 클라이언트측 웹용 Target 구현
- Adobe Experience Platform Web SDK 구현 개요
- at.js 구현
- at.js 개요
- at.js 작동 방식
- at.js를 배포하는 방법
- 온디바이스 의사 결정
- at.js 함수
- at.js 함수 개요
- adobe.target.getOffer()
- adobe.target.getOffers() - at.js 2.x
- adobe.target.applyOffer()
- adobe.target.applyOffers() - at.js 2.x
- adobe.target.triggerView() - at.js 2.x
- adobe.target.trackEvent()
- mboxCreate() - at.js 1.x
- targetGlobalSettings()
- mboxDefine() 및 mboxUpdate() - at.js 1.x
- targetPageParams()
- targetPageParamsAll()
- registerExtension() - at.js 1.x
- sendNotifications() - at.js 2.1
- at.js 사용자 지정 이벤트
- Adobe Experience Cloud Debugger를 사용하여 at.js 디버그
- Target에서 클라우드 기반 인스턴스 사용
- at.js FAQ
- at.js 버전 세부 사항
- at.js 1.x에서 at.js 2.x로 업그레이드
- at.js 쿠키
- 사용자 에이전트 및 클라이언트 힌트
- 글로벌 mbox 이해
- 서버 측 구현
- 하이브리드 구현
- Recommendations 구현
- 모바일 앱 구현
- 전자 메일 구현
- API 안내서
- 구현 패턴