콘텐츠로 건너뛰기

Umgang mit Statistiken

플러그인의 통계를 저장하기 위한 JavaScript 코드 예시입니다

interface AppInfos {
version_name: string
action: 'delete' |
'reset' |
'set' |
'set_fail' |
'update_fail' |
'windows_path_fail' |
'canonical_path_fail' |
'directory_path_fail' |
'unzip_fail' |
'low_mem_fail' |
'download_fail' |
'update_fail' |
'download_10' |
'download_20' |
'download_30' |
'download_40' |
'download_50' |
'download_60' |
'download_70' |
'download_80' |
'download_90' |
'download_complete'
version_build: string
version_code: string
version_os: string
plugin_version: string
platform: string
app_id: string
device_id: string
custom_id?: string
is_prod?: boolean
is_emulator?: boolean
}
export const handler: Handler = async (event) => {
const body = JSONparse(eventbody || '{}') as AppInfos
const {
platform,
app_id,
action,
version_code,
version_os,
device_id,
version_name,
version_build,
plugin_version,
} = body
consolelog('update asked', platform,
app_id,
action,
version_os,
version_code,
device_id,
version_name,
version_build,
plugin_version)
// 데이터베이스에 저장
return { status: 'ok' }
}

이 엔드포인트는 다음과 같은 JSON을 반환해야 합니다:

{ "status": "ok" }

액션:

모든 액션 코드와 그 의미에 대한 자세한 설명은 디버깅 문서를 참조하세요: