Sam
12/06/2018, 11:49 AMKotlinMultiPlatformStorage
https://github.com/netguru/KotlinMultiPlatformStorage. It simplifies persisting key-value data both on iOS and Android 🤖 🍎 in the common code modules. Feel free to use it and to contribute. If you’d like to read more about our story here is a blog post: https://www.netguru.co/codestories/what-weve-learned-by-developing-the-kotlin-multiplatform-storage-librarygildor
12/06/2018, 12:58 PMthevery
12/06/2018, 12:58 PMgildor
12/06/2018, 1:00 PMstreetsofboston
12/06/2018, 1:26 PMkpgalligan
12/06/2018, 1:37 PMSam
12/06/2018, 1:46 PMmultiplatform-settings
, we were studying its implementation carefully and decided that it would be quite a lot changes to make if we’d decide develop it. We had a different vision of the library internal mechanisms, and as the result, there were a few motivations for working on a new library project. First, although the API for key-value storing is similar, we’ve designed the mechanism for base storage class instantiation quite differently. We wanted it to be fully compatible with the new ‘kotlin-multiplatform’ plugin. In the effect, there is no need to pass Context
manually to create it on the 🤖 side. All in all, we are just instantiating a class like this: `MultiPlatformStorage()`(https://github.com/netguru/KotlinMultiPlatformStorage/blob/6841f94e657a3d9e746e3b8555575f6388cbd706/sampleapp/app/src/commonMain/kotlin/com.netguru.sample/MainPresenter.kt#L11) This way there is no need to implement any Factory instances on the platform-specific modules. Everything is just done in the common module. Next, we wanted to use Keychain API instead of UserDefaults. Apart from that, it seemed easier to build it our way from scratch and we just wanted to give it a try.kpgalligan
12/06/2018, 1:56 PMSam
12/06/2018, 1:59 PMkpgalligan
12/06/2018, 2:00 PMrusshwolf
12/06/2018, 2:59 PMexpect
declaration to reference it from common. The purpose of the Factory is really so that you can pass a name in from common while only needing to inject a Context once, which is helpful if you want to organize multiple different storage objects in common code.
On gradle plugins: I've done partial work on updating that but was blocked by publishing support. Open to PRs if other people have it figured out, but I also plan to take another stab at it soon since apparently some folks have it working. If nothing else, though, you can certainly consume the lib from the new plugin even though it's written with the old ones. And that's definitely a different issue than Context injection.kpgalligan
12/06/2018, 3:14 PMSam
12/06/2018, 3:30 PMmultiplatform-settings
purpose and capabilities 🤔 All in all, it’s just highly experimental “product” atm. Also, I’m open to contributing to multiplatform-settings
tookpgalligan
12/06/2018, 3:33 PMgildor
12/06/2018, 4:09 PMkpgalligan
12/06/2018, 4:13 PMlouiscad
12/21/2018, 7:04 PMappCtx
? (Full disclosure: I made it, and it supports multiprocess, and libraries)kpgalligan
12/21/2018, 7:16 PM