Topic 하나 구독 | Push | Appbox Android SDK 가이드
Topic 하나 구독
Topic 하나 구독
AppBox.subscribeTopic(context, topic, callback)
Kotlin
1
AppBox.subscribeTopic(this, "notice") { success, error ->
2
if (!success) Log.w("AppBox", error?.message ?: "topic 구독 실패")
3
}
1
AppBox.subscribeTopic(this, "notice", new AppBoxOperationCallback() {
2
@Override
3
public void onComplete(boolean success, Throwable error) {
4
if (!success) Log.w("AppBox", String.valueOf(error));
5
}
6
});
Request 항목 정의
| Request 항목 | 필수여부 | 설명 | 기본값 |
|---|---|---|---|
| context | 필수 | Application 또는 Activity context | - |
| topic | 필수 | 구독할 topic 이름 | - |
| callback | 필수 | AppBoxOperationCallback | - |
Response 항목 정의
| Response 결과값 | |
|---|---|
success | 서버에 변경 기록 요청이 접수됐는지 (true | false) |
topic 공통 의미론을 따릅니다. success는 접수 의미이며 실제 구독 상태를 보장하지 않습니다.
웹 브릿지에서는 메시지 구독 등록의 message.subscribeToTopic입니다.