알림 권한 상태 확인 | Push | Appbox Android SDK 가이드
알림 권한 상태 확인
알림 권한 상태 확인
AppBox.isPushPermissionGranted(context, callback)
Kotlin
1
AppBox.isPushPermissionGranted(this) { granted, error ->
2
if (error != null) return@isPushPermissionGranted
3
updatePushToggle(granted == true)
4
}
1
AppBox.isPushPermissionGranted(this, new AppBoxValueCallback<Boolean>() {
2
@Override
3
public void onComplete(Boolean granted, Throwable error) {
4
if (error != null) return;
5
updatePushToggle(Boolean.TRUE.equals(granted));
6
}
7
});
Request 항목 정의
| Request 항목 | 필수여부 | 설명 | 기본값 |
|---|---|---|---|
| context | 필수 | Application 또는 Activity context | - |
| callback | 필수 | AppBoxValueCallback<Boolean> | - |
Response 항목 정의
| Response 결과값 | |
|---|---|
granted | 알림 권한 허용 여부 (true | false) |
예외적으로 appbox-push artifact만 있으면 동작합니다. 초기화 설정에 push가 없어도 호출할 수 있습니다. 이 값은 OS 권한 상태입니다. 서비스의 Push 수신 동의(Push 수신 동의 저장)와 다릅니다.