AGENT SKILL

13-push-storage

暂无简介

License 许可
MIT
所属仓库
devwinsoft/devian
最近更新
2026-04-12
Stars
★ 0
Forks
0

02 资源文件 2

03 SKILL.md 正文

13-push-storage

Status: ACTIVE AppliesTo: v10

PushStorage 저장 모델 규약 문서다.


Implementation Location (3-path mirror)

3-path mirror 정책: devian-unity/04-package-policy, devian-unity/01-policy §SSOT 원칙

파일 UPM (정본) Packages (sync) Assets/Samples (import)
PushStorage.cs upm/com.devian.foundation/Samples~/MobilePackage/Runtime/Push/ Packages/com.devian.foundation/Samples~/MobilePackage/Runtime/Push/ Assets/Samples/Devian Foundation/{version}/MobilePackage/Runtime/Push/
LocalNotificationData.cs 동일 경로 동일 경로 동일 경로

Ownership

  • PushManager가 PushStorage를 소유한다.
  • 정본 접근 경계: PushManager.Storage
  • 외부 모듈은 PushStorage를 직접 생성/수정하지 않는다.

Storage Model

필드 정의는 03-ssot §B PushStorage가 정본이다.


SaveData Payload

루트 payload에서 Push 섹션은 push 키를 사용한다.

{
  "version": 15,
  "push": {
    "schemaVersion": 1,
    "token": "fMcT0k3n...",
    "tokenUpdatedAt": "2025-06-01T12:00:00Z",
    "subscribedTopics": ["news", "event"],
    "scheduledNotifications": [
      {
        "notificationId": "daily-reward",
        "title": "보상 수령",
        "body": "일일 보상이 준비되었습니다!",
        "fireAt": "2025-06-02T09:00:00Z",
        "repeatInterval": "daily",
        "payload": "{\"type\":\"reward\"}"
      }
    ]
  }
}

핵심 규칙:

  • push 저장 위치는 반드시 push 키
  • subscribedTopics는 구독 중인 토픽 ID의 정본이다 (초기화 시 재구독 기반)
  • scheduledNotifications는 등록된 로컬 알림의 정본이다 (중복 ID 방지)
  • token은 디버깅/진단 용도의 로컬 캐시이며, 서버 등록에 사용하지 않는다

Deserialize Rules

  • PushStorage.Clear() 후 복원
  • schemaVersion <= 0이면 1로 보정
  • subscribedTopics가 null이면 빈 리스트로 초기화
  • scheduledNotifications가 null이면 빈 리스트로 초기화
  • token이 null/empty이면 빈 문자열 유지 (초기화 시 재획득)
  • 누락 키는 안전 기본값 사용

Clear() 규칙

  • schemaVersion은 현재 버전(1)으로 리셋
  • token, tokenUpdatedAt은 빈 문자열로 리셋
  • subscribedTopics, scheduledNotifications는 빈 리스트로 초기화
  • Clear 후 FCM 토큰/토픽 재등록은 다음 InitializeAsync 호출 시 수행

Related

04 同仓库更多 Skills