My KMP app I’m working on needed a feature and I w...
# feed
j
My KMP app I’m working on needed a feature and I wasn’t satisfied with the current offerings for this functionality. So I created Connectivity!
Connectivity provides network monitoring capabilities for multiplatform projects. It can monitor network connectivity using native APIs on Android and Apple devices, or by making HTTP requests to specified hosts.
It supports Android, Apple devices (excluding WatchOS as NWPath isn’t available), browser (js/wasm), and JVM. I was having some issues getting Linux and Windows targets supported, but they will be added in the future.
K 7
👍 7
p
Any reason why using the StateFlow instead of a SharedFlow with repeat=1 to deal with the problem described in the readme, about the StateFlow initial value.
j
That's a good point! This library originally started off as a part of my app. And in that specific use case I used StateFlow. I'll be changing that, thanks for the tip!
🚀 1
p
Ahh sweet! great I think the alternative of getting the current Connection status synchronously, may take some time depending on the platform. Android has been moving all the connectivity API to a callback based API bc apparently it is taking longer to determine such status
z
Glad to see more features covered by multiplatform. Might even use this in my own app eventually