Push token 조회 | Push | Appbox Android SDK 가이드

Push token 조회

현재 기기의 Push token을 조회합니다. 자체 서버나 외부 도구에서 이 기기를 식별해야 할 때의 상태 확인 용도입니다.

Push token 조회

AppBox.getPushToken(context, callback)

Kotlin
1 AppBox.getPushToken(this) { token, error ->
2 if (error != null) return@getPushToken
3 Log.d("AppBox", "token length=${token?.length}") // 원문은 로그에 남기지 않습니다
4 }
1 AppBox.getPushToken(this, new AppBoxValueCallback<String>() {
2 @Override
3 public void onComplete(String token, Throwable error) {
4 if (error != null) return;
5 Log.d("AppBox", "token length=" + (token == null ? 0 : token.length()));
6 }
7 });

Request 항목 정의

Request 항목필수여부설명기본값
context필수Application 또는 Activity context-
callback필수AppBoxValueCallback<String>-


Response 항목 정의

Response 결과값
token현재 Push token 문자열. 실패 시 null


token을 서버에 등록하는 별도 작업은 필요하지 않습니다. SDK가 자동으로 동기화합니다. token은 민감한 값입니다. 원문을 로그에 출력하지 않습니다.

웹 브릿지에서는 푸시 토큰 요청의 message.getToken입니다.

www.naver.com
QR 코드를 촬영하면 입력하신 주소의
앱 예시 화면을 테스트할 수 있습니다.
* 스캔 후 바로 앱 다운로드 이동합니다.