Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feat [#30] 앱 잠금 기능 구현 #33

Merged
merged 27 commits into from
May 26, 2024
Merged

Feat [#30] 앱 잠금 기능 구현 #33

merged 27 commits into from
May 26, 2024

Conversation

Zoe0929
Copy link
Member

@Zoe0929 Zoe0929 commented May 25, 2024

👾 작업 내용

Shield 관련 타겟과 DeviceMonitor 타겟을 추가하여 앱 잠금 기능을 구현했습니다.
네트워크 연결하면서 더 작업하겠습니다!

🚀 PR Point

🎆 드디어 모든 권한 받기 성공 🎉

  • 출시용 capability 전부 추가했습니다
  • ShieldActionExtension 에서 ShieldView에서 동작을 커스텀할 수 있습니다. 지금은 "연장하기" 버튼을 누르면 푸시를 요청하여 앱으로 진입하도록 유도했습니다.
  case .secondaryButtonPressed:
          requestSendNoti(seconds: 0.5, 
                          title: WebDomain(token: webDomain).domain ?? "")
          completionHandler(.defer)
  • 현재 모니터링을 통해 Shield하는 함수는 잠시 주석 처리 했습니다. 추후에 챌린지 추가 기능 구현하면서 그 부분에서 호출 할 예정입니다.
    // TODO: 챌린지 만드는 시점에 설정
  screenTimeViewModel.handleStartDeviceActivityMonitoring(interval: 1)
  • 선택한 앱을 저장하는 변수를 선언할 때 다음과 같은 메모리 충돌이 발생합니다. 해결하려 노력했지만, 검색해도 해결법이 나오지 않아 아직 보류 상태입니다. 혹시 해결 방법을 하신다면 알려주시면 감사하겠습니다 !
    @AppStorage(AppStorageKey.selectionApp.rawValue, store: UserDefaults(suiteName: APP_GROUP_NAME))
    var selectedApp = FamilyActivitySelection()
// Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.

📸 스크린샷

구현 내용 스크린샷
쉴드뷰 구현 RPReplay_Final1716632407

✅ CheckList

  • 오류 없이 빌드되는지 확인
  • 로그용 print문 제거
  • 불필요한 주석 제거
  • 코드 컨벤션 확인

🔗 Issue

Resolved #30

@Zoe0929 Zoe0929 added 🐰지희 지희의 issue ✨FEAT 기능 구현 labels May 25, 2024
@Zoe0929 Zoe0929 added this to the 🔭2차 스프린트🪐 milestone May 25, 2024
@Zoe0929 Zoe0929 requested a review from kim-seonwoo May 25, 2024 15:14
@Zoe0929 Zoe0929 self-assigned this May 25, 2024
@Zoe0929 Zoe0929 linked an issue May 25, 2024 that may be closed by this pull request
@Zoe0929 Zoe0929 changed the title Feat/#30 target config [Feat/#30] 앱 잠금 기능 구현 May 25, 2024
@Zoe0929 Zoe0929 changed the title [Feat/#30] 앱 잠금 기능 구현 Feat [#30] 앱 잠금 기능 구현 May 25, 2024
Copy link
Member

@kim-seonwoo kim-seonwoo left a comment

Choose a reason for hiding this comment

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

오,..어렵네요...!
수고 많으셨습니다ㅏ..

@AppStorage(AppStorageKey.selectionApp.rawValue, store: UserDefaults(suiteName: APP_GROUP_NAME))
var selectionApps = FamilyActivitySelection()

@StateObject var screenTimeVM = ScreenTimeViewModel()
Copy link
Member

Choose a reason for hiding this comment

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

❓ ScreenTimeViewModel이 곧곧에서 굉장히 많이쓰이는데요..
싱글톤으로 선언하는게 나을지, 지금 처럼 StateObject를 여러곳에서 선언하는게 나을지
궁금합니다..

Copy link
Member Author

Choose a reason for hiding this comment

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

사실 이부분 진짜 고민이 많은데요,, 제 생각에는(짧게 생각했을 때) 싱글톤 사용하는 게 메모리 차원에서도, 관리 차원에도 좋을 것 같습니다!
이 부분 검토 한번 해보고 수정하겠습니다~

@Zoe0929 Zoe0929 merged commit e51b0f9 into develop May 26, 2024
@Zoe0929 Zoe0929 deleted the feat/#30-targetConfig branch June 19, 2024 02:22
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
✨FEAT 기능 구현 🐰지희 지희의 issue
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feat] 스크린타임 가져오기
2 participants