Push token 조회 | Push | Appbox Android SDK 가이드
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입니다.