0

I am working on a Kotlin Multiplatform Project and I need to access following device data

  • appVersion
  • connection type: Wifi or cellular
  • Carrier
  • Os version
  • Device model

How can I access following data from an iOS as well as Android device in a kotlin multiplatform project?

Can I access them in iOS main and Android main or do I need to pass some reference?

OkDroid
  • 185
  • 3
  • 11

1 Answers1

3

One of the Kotlin Multiplatform's core features is an ability to utilize platform-specific APIs. See an explanation and examples here. I would recommend you to go through the Web and search for a way people get this data on Android or iOS natively, and then re-implement those approaches in your project - Android main contents won't take a lot of time to be adjusted. iOS one might be a little more complicated, but all Apple's frameworks should be accessible as platform.<FrameworkName> and their usage won't be too different from Objective-C's one. For the app version, to begin with, I think those pieces of advice would be good examples: iOS & Android.

Artyom Degtyarev
  • 2,704
  • 8
  • 23