Skip to content

Conversation

@MoonsuKang
Copy link
Member

Related issue 🛠

closed #167

어떤 변경사항이 있었나요?

  • 🐞 BugFix Something isn't working
  • 🎨 Design Markup & styling
  • 📃 Docs Documentation writing and editing (README.md, etc.)
  • ✨ Feature Feature
  • 🔨 Refactor Code refactoring
  • ⚙️ Setting Development environment setup
  • ✅ Test Test related (Junit, etc.)

CheckPoint ✅

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • PR 컨벤션에 맞게 작성했습니다. (필수)
  • merge할 브랜치의 위치를 확인해 주세요(main❌/develop⭕) (필수)
  • Approve된 PR은 assigner가 머지하고, 수정 요청이 온 경우 수정 후 다시 push를 합니다. (필수)
  • BugFix의 경우, 버그의 원인을 파악하였습니다. (선택)

Work Description ✏️

  • 사용자가 처음으로 해제한 알람의 ID를 저장

  • 하루가 지나면 자동 초기화되도록 UserPreferences에서 관리

  • 운세 확인 시 첫 알람 여부에 따른 보상 분기 처리

  • FortuneViewModel에서 firstDismissedAlarmId를 구독하여 hasReward 결정

  • FortuneCompletePage에서 hasReward 값에 따라 버튼 및 메시지 변경

  • onCompleteClick에서 hasReward에 따라 NextStep 또는 NavigateToHome 호출

Uncompleted Tasks 😅

  • Task1

To Reviewers 📢

@DongChyeon
Copy link
Member

develop에서 브랜치 파는게 아니라 기존 작업하던 다른 브랜치에서 파니까 꼬이는 거 같아요

Comment on lines 93 to 100
private fun dismiss() {
sendAlarmDismissEventToAlarmReceiver()
alarm?.id?.let { alarmId ->
viewModelScope.launch {
userPreferences.saveFirstDismissedAlarmId(alarmId)
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[p1]
알람 해제 화면 -> 알람 미루기 -> 알람 해제 화면
알람 미루기를 통해 다시 알람 해제 화면이 뜨기도 하기 때문에
해당 화면에서 알람 끄기 버튼을 눌렀다는 게 첫 화면에서 해제했다는 걸 보장해주지 못해요.
그리고 푸시 알람에 있는 알람 해제 액션 버튼을 눌러서 끄는 경우도 있어요.

override fun onReceive(context: Context?, intent: Intent?) {
    context ?: return
    intent ?: return

    val alarmServiceIntent = createAlarmServiceIntent(context, intent)
    when (intent.action) {
        AlarmConstants.ACTION_ALARM_TRIGGERED -> {
            Log.d("AlarmReceiver", "Alarm Triggered")
            context.startForegroundService(alarmServiceIntent)
        }

        AlarmConstants.ACTION_ALARM_SNOOZED -> {
            Log.d("AlarmReceiver", "Alarm Snoozed")
            val alarm: Alarm? = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
                intent.getParcelableExtra(AlarmConstants.EXTRA_ALARM, Alarm::class.java)
            } else {
                @Suppress("DEPRECATION")
                intent.getParcelableExtra(AlarmConstants.EXTRA_ALARM)
            }

            alarm?.let { handleSnooze(context, it) }
        }

        AlarmConstants.ACTION_ALARM_DISMISSED -> {
            Log.d("AlarmReceiver", "Alarm Dismissed")
            context.stopService(alarmServiceIntent)
            sendBroadCastToCloseAlarmInteractionActivity(context)
        }
    }
}

그래서 AlarmReceiver 클래스에서 AlarmConstants.ACTION_ALARM_DISMISSED 일 때, 첫번째 알람 해제를 판별하여 저장하는 로직이 필요합니다....

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다시 여쭤보니

오늘 운세를 안 받았을 때

  • 알림 해제 -> 미션 -> 운세

오늘 운세를 이미 받았을 때

  • 알림 해제

오늘 운세를 안 받았을 때, 첫 알람에서 미션까지 수행하여 운세를 받게된다면 부적까지 획득 가능
(다만, 첫 알람이 아닌 두 번째 알람부터면 운세만 획득 가능, 부적 획득 불가능)
오늘 운세를 안 받았을 때, 첫 알람에서 미션을 수행하지 못해서 운세를 못 받았더라도 이후 알람에서 미션 수행 시 운세 획득 가능


해당 기획서 내용에 따르면은 오늘 첫 알람 (당일 가장 빠른 시간에 설정되어 있는 알람)미션 수행 했는지 여부를 저장해야 할 것 같아요.

@MoonsuKang MoonsuKang closed this Feb 21, 2025
@MoonsuKang MoonsuKang deleted the feat/#167-fortune-branch branch February 21, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 운세 보상에 대한 분기처리를 진행합니다.

3 participants