@pulseboard/react-native 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,7 @@ Pod::Spec.new do |s|
23
23
  install_modules_dependencies(s)
24
24
 
25
25
  s.pod_target_xcconfig = {
26
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
26
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
27
27
  "CLANG_ENABLE_MODULES" => "YES",
28
28
  }
29
29
  end
@@ -4,6 +4,8 @@
4
4
  #import <CoreTelephony/CTCarrier.h>
5
5
  #include <arpa/inet.h>
6
6
  #include <ifaddrs.h>
7
+ #include <netdb.h> // ← fixes NI_MAXHOST and NI_NUMERICHOST
8
+ #include <sys/socket.h>
7
9
 
8
10
  @implementation PulseBoardNetwork
9
11
 
@@ -26,12 +28,13 @@
26
28
  dispatch_queue_t queue = dispatch_queue_create(
27
29
  "com.pulseboard.network", DISPATCH_QUEUE_SERIAL);
28
30
 
31
+ // ← correct API: set handler first, then start with queue
29
32
  nw_path_monitor_set_update_handler(monitor, ^(nw_path_t path) {
30
33
  nw_path_monitor_cancel(monitor);
31
34
 
32
- BOOL isConnected = nw_path_get_status(path) == nw_path_status_satisfied;
33
- BOOL isWifi = nw_path_uses_interface_type(path, nw_interface_type_wifi);
34
- BOOL isCellular = nw_path_uses_interface_type(path, nw_interface_type_cellular);
35
+ BOOL isConnected = nw_path_get_status(path) == nw_path_status_satisfied;
36
+ BOOL isWifi = nw_path_uses_interface_type(path, nw_interface_type_wifi);
37
+ BOOL isCellular = nw_path_uses_interface_type(path, nw_interface_type_cellular);
35
38
 
36
39
  NSString *carrier = @"unknown";
37
40
  if (@available(iOS 12.0, *)) {
@@ -44,10 +47,10 @@
44
47
  }
45
48
 
46
49
  NSString *type;
47
- if (isWifi) type = @"wifi";
48
- else if (isCellular) type = @"cellular";
49
- else if (isConnected) type = @"unknown";
50
- else type = @"offline";
50
+ if (isWifi) type = @"wifi";
51
+ else if (isCellular) type = @"cellular";
52
+ else if (isConnected) type = @"unknown";
53
+ else type = @"offline";
51
54
 
52
55
  resolve(@{
53
56
  @"type": type,
@@ -58,7 +61,8 @@
58
61
  });
59
62
  });
60
63
 
61
- nw_path_monitor_start(monitor, queue);
64
+ nw_path_monitor_set_queue(monitor, queue); // ← set queue separately
65
+ nw_path_monitor_start(monitor); // ← then start with no queue arg
62
66
  }
63
67
 
64
68
  - (nullable NSString *)getIPAddress {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulseboard/react-native",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "Official PulseBoard SDK for React Native",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",