앱 업데이트 | 사용자 경험, 알림, 인터랙션 | Appbox Android SDK 가이드
앱 업데이트
updatePrompt(require, message, googlePlay, updateButton, cancelButton?, updateAlert?, callback)
호출 형태: 패턴 D(선택 인자가 여러 개인 함수). 실행 중에 다시 호출하면 거절됩니다.
앱을 최신 버전으로 업데이트
AppBox.updatePrompt(require, message, googlePlay, updateButton, cancelButton, updateAlert, callback)
Kotlin
1
AppBox.updatePrompt(require = false, message = "마켓에 새로운 버전이 있습니다.",
2
googlePlay = "https://play.google.com/store/apps/details?id=com.example.app",
3
updateButton = "업데이트", cancelButton = "다음에", updateAlert = true) { value, error ->
4
if (error != null) return@updatePrompt
5
Log.d("AppBox", value.toString())
6
}
1
AppBox.updatePrompt(false, "마켓에 새로운 버전이 있습니다.",
2
"https://play.google.com/store/apps/details?id=com.example.app",
3
"업데이트", "다음에", true, (value, error) -> {
4
if (error != null) return;
5
Log.d("AppBox", String.valueOf(value));
6
});
Request 항목 정의
| Request 항목 | 필수여부 | 설명 | 기본값 |
|---|---|---|---|
require | 필수 | true면 강제 업데이트(닫을 수 없음), false면 권장 | - |
message | 필수 | 업데이트 안내 메시지 | - |
googlePlay | 필수 | Google Play 다운로드 URL. https://play.google.com/store/apps/details?id={패키지명} 형식 | - |
updateButton | 필수 | 업데이트 버튼 텍스트 | - |
cancelButton | - | 취소 버튼 텍스트. require가 false면 사실상 필수입니다 | - |
updateAlert | - | 업데이트 안내를 SDK가 띄울지 여부. false면 앱이 직접 띄웁니다 | true |
Response 항목 정의
| Response 결과값 | |
|---|---|
| 값 | Map<String, Boolean> |
| 오류 코드 | -6000: 스토어에서 앱을 찾을 수 없음. 마켓에 등록하지 않은 빌드로 테스트하는 경우 |
웹 브릿지에서는 앱 업데이트의 application.updatePrompt입니다.