wifidirectplugin 1.1.3 → 1.1.5

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.
@@ -36,7 +36,13 @@ public class WifiDirectPlugin extends Plugin {
36
36
  NetworkInfo networkInfo = intent.getParcelableExtra(WifiP2pManager.EXTRA_NETWORK_INFO);
37
37
  if (networkInfo != null && networkInfo.isConnected()) {
38
38
  Log.d(TAG, "Wi-Fi Direct connected");
39
-
39
+ manager.requestConnectionInfo(channel, wifiP2pInfo -> {
40
+ if(wifiP2pInfo.groupFormed && wifiP2pInfo.isGroupOwner) {
41
+ Log.d(TAG, "Group Owner IP: " + wifiP2pInfo.groupOwnerAddress.getHostAddress());
42
+ } else if (wifiP2pInfo.groupFormed) {
43
+ Log.d(TAG, "Client connected, Group Owner IP: " + wifiP2pInfo.groupOwnerAddress.getHostAddress());
44
+ }
45
+ });
40
46
  // 필요한 경우 연결된 상태를 Flutter/Ionic에 전달하는 코드를 여기서 실행
41
47
  // 예: call JavaScript 이벤트 전송 또는 콜백 호출
42
48
  } else {
@@ -90,6 +96,7 @@ public class WifiDirectPlugin extends Plugin {
90
96
  deviceJson.put("deviceAddress", device.deviceAddress);
91
97
  deviceJson.put("status", device.status);
92
98
  deviceJson.put("connected", device.status == WifiP2pDevice.CONNECTED);
99
+
93
100
  devicesJson.put(deviceJson);
94
101
  } catch (JSONException e) {
95
102
  Log.e(TAG, "JSON error: ", e);
@@ -119,7 +126,7 @@ public class WifiDirectPlugin extends Plugin {
119
126
  }
120
127
  String deviceAddress = call.getString("deviceAddress");
121
128
  Log.d(TAG, "Device Address: " + deviceAddress);
122
- String pin = call.getString("pin");
129
+ String pin = "00000000";
123
130
 
124
131
  if(deviceAddress == null) {
125
132
  Log.e(TAG, "Device address is null");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wifidirectplugin",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "HT-Installer Wifi Direct Plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",