https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
f

Farhazul Mullick

03/01/2024, 3:09 PM
How can i import Classes like NWPathMonitor in iosmain for network observation
m

Michael Krussel

03/01/2024, 3:37 PM
You need to go a bit lower level I'm using
nw_path_monitor_create()
,
nw_path_monitor_set_queue
,
nw_path_monitor_set_update_handler
, etc.
They're all in the
platform.Network
package.
f

Farhazul Mullick

03/01/2024, 4:27 PM
Can you share screenshots if possible. Since not able to import directly
m

Michael Krussel

03/01/2024, 4:38 PM
Copy code
import platform.Network.nw_path_get_status
import platform.Network.nw_path_monitor_cancel
import platform.Network.nw_path_monitor_create
import platform.Network.nw_path_monitor_set_queue
import platform.Network.nw_path_monitor_set_update_handler
import platform.Network.nw_path_monitor_start
import platform.Network.nw_path_status_satisfied
import platform.darwin.dispatch_get_main_queue
This is in source code that is in
iosMain
source set.
👌 1
e

Enol Simón

03/11/2024, 1:14 AM
18 Views