-
Notifications
You must be signed in to change notification settings - Fork 32
Support installation #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
忽然想起由于服务端的一个限制,Installation 不允许 PUT 请求,还得做一下特殊处理。 |
|
已经做了特殊处理。 |
|
|
||
| let name = "StorageContext" | ||
|
|
||
| var type = LocalStorageType.fileCacheOrMemory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉 filePersistent 更好?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
又想了一下,还是 fileCacheOrMemory 吧。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里我也犹豫过。我主要考虑到 API 对 installation 已经做了基于 device token 的校验和插入,用 fileCacheOrMemory 好像更合适一些。但是如果把 currentUser 也存到 storage context 里面,用 fileCacheOrMemory 好像就不太合适了,因为可能会被系统清理。
要不还是改为 filePersistent 吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
依据官方的 guideline 来看,感觉 installation 的缓存属于 2 类型,放 /Library/Caches 就行;user 的缓存属于 1 类型,持久并可以被备份。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也行,后面把它俩分开放吧。
支持了 Installation 及其缓存。目前 currentInstallation 是 Application 的一个属性。
@zapcannon87