채널 전화번호 저장 | Push | Appbox Android SDK 가이드
채널 전화번호 저장
채널 전화번호 저장
AppBox.setChannelPhoneNumber(context, phoneNumber, consent, callback)
Kotlin
1
// 채널 수신 동의를 함께 저장
2
AppBox.setChannelPhoneNumber(this, "+821000000000", true) { success, error ->
3
if (!success) Log.w("AppBox", error?.message ?: "전화번호 저장 실패")
4
}
5
6
// 동의값 없이 전화번호만 저장
7
AppBox.setChannelPhoneNumber(this, "+821000000000") { success, error -> }
1
// 채널 수신 동의를 함께 저장
2
AppBox.setChannelPhoneNumber(this, "+821000000000", true, new AppBoxOperationCallback() {
3
@Override
4
public void onComplete(boolean success, Throwable error) {
5
if (!success) Log.w("AppBox", String.valueOf(error));
6
}
7
});
8
9
// 동의값 없이 전화번호만 저장
10
AppBox.setChannelPhoneNumber(this, "+821000000000", new AppBoxOperationCallback() {
11
@Override
12
public void onComplete(boolean success, Throwable error) { }
13
});
Request 항목 정의
| Request 항목 | 필수여부 | 설명 | 기본값 |
|---|---|---|---|
| context | 필수 | Application 또는 Activity context | - |
| phoneNumber | 필수 | 국가번호를 포함한 형식을 권장합니다. 빈 값이면 오류 | - |
| consent | - | SMS, 알림 채널 수신 동의값. 생략하면 서버 요청에서 제외됩니다 | 생략 |
| callback | 필수 | AppBoxOperationCallback | - |
Response 항목 정의
| Response 결과값 | |
|---|---|
success | 저장 요청 성공 여부 (true | false) |
consent는 채널 수신 동의입니다. Push 수신 동의(setPushAgreement)와 다른 값입니다. 전화번호는 개인정보입니다. 수집 근거를 먼저 확보하고 로그에 남기지 않습니다. appbox-webview는 필요하지 않습니다.
웹 브릿지에서는 message.setChannelPhoneNumber입니다.