wifidirectplugin 1.1.4 → 1.1.6

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,6 @@ 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
-
40
39
  // 필요한 경우 연결된 상태를 Flutter/Ionic에 전달하는 코드를 여기서 실행
41
40
  // 예: call JavaScript 이벤트 전송 또는 콜백 호출
42
41
  } else {
@@ -163,5 +162,18 @@ public class WifiDirectPlugin extends Plugin {
163
162
 
164
163
  }
165
164
 
165
+ @PluginMethod
166
+ public void getGroupOwnerAddress(PluginCall call) {
167
+ manager.requestConnectionInfo(channel, wifiP2pInfo -> {
168
+ if (wifiP2pInfo.groupFormed) {
169
+ String ip = wifiP2pInfo.groupOwnerAddress.getHostAddress();
170
+ JSObject ret = new JSObject();
171
+ ret.put("Ip", ip);
172
+ call.resolve(ret);
173
+ } else {
174
+ call.reject("No Wi-Fi P2P group formed");
175
+ }
176
+ });
177
+ }
166
178
 
167
179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wifidirectplugin",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "HT-Installer Wifi Direct Plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",