알림 권한 상태 확인 | 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 수신 동의 저장)와 다릅니다.

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