@cappitolian/network-discovery 0.0.12 → 0.0.14
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.
- package/Package.swift +27 -27
- package/README.md +228 -365
- package/android/src/main/java/com/cappitolian/plugins/networkdiscovery/NetworkDiscovery.java +157 -216
- package/android/src/main/java/com/cappitolian/plugins/networkdiscovery/NetworkDiscoveryPlugin.java +61 -115
- package/dist/docs.json +63 -146
- package/dist/esm/definitions.d.ts +48 -37
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +4 -11
- package/dist/esm/web.js +9 -11
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +9 -11
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +9 -11
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/NetworkDiscoveryPlugin/NetworkDiscovery.swift +145 -132
- package/ios/Sources/NetworkDiscoveryPlugin/NetworkDiscoveryPlugin.swift +42 -103
- package/package.json +85 -85
package/Package.swift
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
// swift-tools-version: 5.9
|
|
2
|
-
import PackageDescription
|
|
3
|
-
|
|
4
|
-
let package = Package(
|
|
5
|
-
name: "CappitolianNetworkDiscovery",
|
|
6
|
-
platforms: [.iOS(.v15)],
|
|
7
|
-
products: [
|
|
8
|
-
.library(
|
|
9
|
-
name: "CappitolianNetworkDiscovery",
|
|
10
|
-
targets: ["NetworkDiscoveryPlugin"])
|
|
11
|
-
],
|
|
12
|
-
dependencies: [
|
|
13
|
-
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
14
|
-
],
|
|
15
|
-
targets: [
|
|
16
|
-
.target(
|
|
17
|
-
name: "NetworkDiscoveryPlugin",
|
|
18
|
-
dependencies: [
|
|
19
|
-
.product(name: "Capacitor", package: "capacitor-swift-pm"),
|
|
20
|
-
.product(name: "Cordova", package: "capacitor-swift-pm")
|
|
21
|
-
],
|
|
22
|
-
path: "ios/Sources/NetworkDiscoveryPlugin"),
|
|
23
|
-
.testTarget(
|
|
24
|
-
name: "NetworkDiscoveryPluginTests",
|
|
25
|
-
dependencies: ["NetworkDiscoveryPlugin"],
|
|
26
|
-
path: "ios/Tests/NetworkDiscoveryPluginTests")
|
|
27
|
-
]
|
|
1
|
+
// swift-tools-version: 5.9
|
|
2
|
+
import PackageDescription
|
|
3
|
+
|
|
4
|
+
let package = Package(
|
|
5
|
+
name: "CappitolianNetworkDiscovery",
|
|
6
|
+
platforms: [.iOS(.v15)],
|
|
7
|
+
products: [
|
|
8
|
+
.library(
|
|
9
|
+
name: "CappitolianNetworkDiscovery",
|
|
10
|
+
targets: ["NetworkDiscoveryPlugin"])
|
|
11
|
+
],
|
|
12
|
+
dependencies: [
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
|
|
14
|
+
],
|
|
15
|
+
targets: [
|
|
16
|
+
.target(
|
|
17
|
+
name: "NetworkDiscoveryPlugin",
|
|
18
|
+
dependencies: [
|
|
19
|
+
.product(name: "Capacitor", package: "capacitor-swift-pm"),
|
|
20
|
+
.product(name: "Cordova", package: "capacitor-swift-pm")
|
|
21
|
+
],
|
|
22
|
+
path: "ios/Sources/NetworkDiscoveryPlugin"),
|
|
23
|
+
.testTarget(
|
|
24
|
+
name: "NetworkDiscoveryPluginTests",
|
|
25
|
+
dependencies: ["NetworkDiscoveryPlugin"],
|
|
26
|
+
path: "ios/Tests/NetworkDiscoveryPluginTests")
|
|
27
|
+
]
|
|
28
28
|
)
|
package/README.md
CHANGED
|
@@ -1,365 +1,228 @@
|
|
|
1
|
-
# @cappitolian/network-discovery
|
|
2
|
-
|
|
3
|
-
A Capacitor plugin for network service discovery using mDNS/Bonjour. Allows automatic server-client connection without manual IP configuration.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Features
|
|
8
|
-
|
|
9
|
-
- **
|
|
10
|
-
- **Discover services** automatically (client mode)
|
|
11
|
-
- Pass custom
|
|
12
|
-
-
|
|
13
|
-
- Works on **iOS** (Bonjour) and **Android** (NSD)
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
console.log('
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
###
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
//
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
---
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
#### `serviceLost`
|
|
235
|
-
|
|
236
|
-
Fired when a previously discovered service is no longer available.
|
|
237
|
-
|
|
238
|
-
**Payload:**
|
|
239
|
-
```typescript
|
|
240
|
-
{
|
|
241
|
-
serviceName: string;
|
|
242
|
-
serviceType: string;
|
|
243
|
-
}
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
---
|
|
247
|
-
|
|
248
|
-
## Service Type Format
|
|
249
|
-
|
|
250
|
-
Service types must follow the format: `_name._protocol`
|
|
251
|
-
|
|
252
|
-
**Common examples:**
|
|
253
|
-
- `_http._tcp` - HTTP service
|
|
254
|
-
- `_https._tcp` - HTTPS service
|
|
255
|
-
- `_myapp._tcp` - Custom app service
|
|
256
|
-
- `_ssh._tcp` - SSH service
|
|
257
|
-
|
|
258
|
-
**Recommended for apps:** Use a custom service type like `_myapp._tcp` to avoid conflicts with other services.
|
|
259
|
-
|
|
260
|
-
---
|
|
261
|
-
|
|
262
|
-
## Permissions
|
|
263
|
-
|
|
264
|
-
### Android
|
|
265
|
-
|
|
266
|
-
Add to `AndroidManifest.xml`:
|
|
267
|
-
```xml
|
|
268
|
-
<uses-permission android:name="android.permission.INTERNET" />
|
|
269
|
-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
270
|
-
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
|
271
|
-
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### iOS
|
|
275
|
-
|
|
276
|
-
No additional permissions required. Bonjour is enabled by default.
|
|
277
|
-
|
|
278
|
-
Optionally, add to `Info.plist` to declare your service:
|
|
279
|
-
```xml
|
|
280
|
-
<key>NSBonjourServices</key>
|
|
281
|
-
<array>
|
|
282
|
-
<string>_myapp._tcp</string>
|
|
283
|
-
</array>
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## Platforms
|
|
289
|
-
|
|
290
|
-
- **iOS** (Bonjour/NetService)
|
|
291
|
-
- **Android** (Network Service Discovery)
|
|
292
|
-
- **Web** (Not implemented - throws unimplemented error)
|
|
293
|
-
|
|
294
|
-
---
|
|
295
|
-
|
|
296
|
-
## Requirements
|
|
297
|
-
|
|
298
|
-
- [Capacitor 7+](https://capacitorjs.com/)
|
|
299
|
-
- [Ionic 8+](https://ionicframework.com/) (optional, but tested)
|
|
300
|
-
- iOS 12.0+
|
|
301
|
-
- Android API 16+ (Android 4.1+)
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
## Troubleshooting
|
|
306
|
-
|
|
307
|
-
### Services not being discovered
|
|
308
|
-
|
|
309
|
-
1. **Check both devices are on the same WiFi network**
|
|
310
|
-
2. **Verify service types match** exactly between server and client
|
|
311
|
-
3. **Check firewall settings** - some networks block mDNS
|
|
312
|
-
4. **Android:** Ensure multicast is enabled on your network
|
|
313
|
-
5. **iOS:** Make sure device is not in Low Power Mode
|
|
314
|
-
|
|
315
|
-
### Server not advertising
|
|
316
|
-
|
|
317
|
-
1. **Verify port is not in use** by another service
|
|
318
|
-
2. **Check network permissions** are granted
|
|
319
|
-
3. **Restart the app** after installing the plugin
|
|
320
|
-
|
|
321
|
-
### General debugging
|
|
322
|
-
|
|
323
|
-
Enable verbose logging:
|
|
324
|
-
```typescript
|
|
325
|
-
// Check plugin is loaded
|
|
326
|
-
console.log('Plugin available:', NetworkDiscovery);
|
|
327
|
-
|
|
328
|
-
// Log all events
|
|
329
|
-
NetworkDiscovery.addListener('serviceFound', (s) => console.log('Found:', s));
|
|
330
|
-
NetworkDiscovery.addListener('serviceLost', (s) => console.log('Lost:', s));
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
---
|
|
334
|
-
|
|
335
|
-
## Use Cases
|
|
336
|
-
|
|
337
|
-
- **Auto-connect apps** - Client automatically finds and connects to server
|
|
338
|
-
- **Local multiplayer games** - Discover game hosts on LAN
|
|
339
|
-
- **IoT device discovery** - Find smart devices without configuration
|
|
340
|
-
- **File sharing apps** - Discover peers for file transfer
|
|
341
|
-
- **Remote control apps** - Find controllable devices automatically
|
|
342
|
-
|
|
343
|
-
---
|
|
344
|
-
|
|
345
|
-
## License
|
|
346
|
-
|
|
347
|
-
MIT
|
|
348
|
-
|
|
349
|
-
---
|
|
350
|
-
|
|
351
|
-
## Support
|
|
352
|
-
|
|
353
|
-
If you encounter any issues or have feature requests, please open an issue on the [GitHub repository](https://github.com/alessandrycruz1987/network-discovery).
|
|
354
|
-
|
|
355
|
-
---
|
|
356
|
-
|
|
357
|
-
## Contributing
|
|
358
|
-
|
|
359
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
360
|
-
|
|
361
|
-
---
|
|
362
|
-
|
|
363
|
-
## Credits
|
|
364
|
-
|
|
365
|
-
Created for use with Capacitor 7 and Ionic 8 applications requiring automatic network service discovery.
|
|
1
|
+
# @cappitolian/network-discovery
|
|
2
|
+
|
|
3
|
+
A Capacitor plugin for network service discovery using mDNS/Bonjour. Allows automatic server-client connection without manual IP configuration.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Publish services** on the local network (server mode)
|
|
10
|
+
- **Discover services** automatically (client mode)
|
|
11
|
+
- Pass custom metadata via TXT records (like HTTP port, version, etc.)
|
|
12
|
+
- Anti-ghosting IP resolution logic
|
|
13
|
+
- Works on **iOS** (Bonjour/NWListener) and **Android** (NSD)
|
|
14
|
+
- Cross-platform compatible: iOS ↔ Android in both directions
|
|
15
|
+
- Tested with **Capacitor 7** and **Ionic 8**
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
```bash
|
|
21
|
+
npm install @cappitolian/network-discovery
|
|
22
|
+
npx cap sync
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Import
|
|
30
|
+
```typescript
|
|
31
|
+
import { NetworkDiscovery } from '@cappitolian/network-discovery';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Server Mode - Publish Your Service
|
|
35
|
+
```typescript
|
|
36
|
+
// Start publishing your server
|
|
37
|
+
await NetworkDiscovery.startServer({
|
|
38
|
+
serviceName: 'SSSPOSServer',
|
|
39
|
+
serviceType: '_ssspos._tcp',
|
|
40
|
+
port: 8081, // Discovery service port
|
|
41
|
+
ip: '192.168.1.100', // Your server IP
|
|
42
|
+
metadata: {
|
|
43
|
+
httpPort: '8080', // Your actual HTTP server port
|
|
44
|
+
version: '1.0.0', // Any custom data
|
|
45
|
+
deviceName: 'Main Server'
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
console.log('Server is now discoverable on the network');
|
|
50
|
+
|
|
51
|
+
// Stop publishing when needed
|
|
52
|
+
await NetworkDiscovery.stopServer();
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Client Mode - Discover Services
|
|
56
|
+
```typescript
|
|
57
|
+
// Find a server on the network
|
|
58
|
+
const result = await NetworkDiscovery.findServer({
|
|
59
|
+
serviceName: 'SSSPOSServer',
|
|
60
|
+
serviceType: '_ssspos._tcp',
|
|
61
|
+
timeout: 15000 // Optional, defaults to 10000ms
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (result) {
|
|
65
|
+
console.log('Server found!');
|
|
66
|
+
console.log('IP:', result.ip);
|
|
67
|
+
console.log('Discovery Port:', result.port);
|
|
68
|
+
console.log('HTTP Port:', result.metadata.httpPort);
|
|
69
|
+
console.log('Version:', result.metadata.version);
|
|
70
|
+
|
|
71
|
+
// Connect to your HTTP server
|
|
72
|
+
const httpUrl = `http://${result.ip}:${result.metadata.httpPort}`;
|
|
73
|
+
// Make your API calls here
|
|
74
|
+
} else {
|
|
75
|
+
console.log('Server not found within timeout');
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## API Reference
|
|
82
|
+
|
|
83
|
+
### Methods
|
|
84
|
+
|
|
85
|
+
#### `startServer(options: StartServerOptions)`
|
|
86
|
+
|
|
87
|
+
Publishes a service on the local network.
|
|
88
|
+
|
|
89
|
+
**Parameters:**
|
|
90
|
+
```typescript
|
|
91
|
+
{
|
|
92
|
+
serviceName: string; // Name of your service
|
|
93
|
+
serviceType: string; // Service type (e.g., "_ssspos._tcp")
|
|
94
|
+
port: number; // Discovery service port
|
|
95
|
+
ip: string; // Your server IP address
|
|
96
|
+
metadata?: { // Optional custom key-value pairs
|
|
97
|
+
[key: string]: string;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### `stopServer()`
|
|
103
|
+
|
|
104
|
+
Stops publishing the service.
|
|
105
|
+
|
|
106
|
+
#### `findServer(options: FindServerOptions)`
|
|
107
|
+
|
|
108
|
+
Searches for a service on the local network.
|
|
109
|
+
|
|
110
|
+
**Parameters:**
|
|
111
|
+
```typescript
|
|
112
|
+
{
|
|
113
|
+
serviceName: string;
|
|
114
|
+
serviceType: string;
|
|
115
|
+
timeout?: number; // Default: 10000ms
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Returns:**
|
|
120
|
+
```typescript
|
|
121
|
+
{
|
|
122
|
+
ip: string;
|
|
123
|
+
port: number;
|
|
124
|
+
metadata: { [key: string]: string };
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Architecture Best Practices
|
|
131
|
+
|
|
132
|
+
### Separate Ports Pattern
|
|
133
|
+
```
|
|
134
|
+
Port 8080 → HTTP Server (GET, POST, API endpoints)
|
|
135
|
+
Port 8081 → Network Discovery (mDNS/Bonjour)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Why:**
|
|
139
|
+
1. Avoids port binding conflicts
|
|
140
|
+
2. Clear separation of concerns
|
|
141
|
+
3. Easier debugging
|
|
142
|
+
4. HTTP server can restart without affecting discovery
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Permissions
|
|
147
|
+
|
|
148
|
+
### Android
|
|
149
|
+
```xml
|
|
150
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
151
|
+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
152
|
+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
|
153
|
+
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### iOS
|
|
157
|
+
```xml
|
|
158
|
+
<key>NSLocalNetworkUsageDescription</key>
|
|
159
|
+
<string>This app needs access to the local network to discover and connect to other devices.</string>
|
|
160
|
+
|
|
161
|
+
<key>NSBonjourServices</key>
|
|
162
|
+
<array>
|
|
163
|
+
<string>_ssspos._tcp</string>
|
|
164
|
+
</array>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Cross-Platform Compatibility
|
|
170
|
+
|
|
171
|
+
| Server → Client | Status |
|
|
172
|
+
|----------------|--------|
|
|
173
|
+
| Android → Android | ✅ Working |
|
|
174
|
+
| Android → iOS | ✅ Working |
|
|
175
|
+
| iOS → Android | ✅ Working |
|
|
176
|
+
| iOS → iOS | ✅ Working |
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Troubleshooting
|
|
181
|
+
|
|
182
|
+
### Services not being discovered
|
|
183
|
+
|
|
184
|
+
1. Check both devices are on same WiFi network
|
|
185
|
+
2. Verify service types match exactly
|
|
186
|
+
3. Check firewall/router settings (some block mDNS)
|
|
187
|
+
4. Android: Ensure multicast is enabled
|
|
188
|
+
5. iOS: Device not in Low Power Mode
|
|
189
|
+
|
|
190
|
+
### iOS Server not visible to Android
|
|
191
|
+
|
|
192
|
+
**Fixed in v1.0.0+**
|
|
193
|
+
|
|
194
|
+
If still experiencing issues:
|
|
195
|
+
1. Update to latest version
|
|
196
|
+
2. Use separate ports (8080 for HTTP, 8081 for discovery)
|
|
197
|
+
3. Check logs for "iOS Servidor LISTO" (iOS) and "NSD_DEBUG" (Android)
|
|
198
|
+
|
|
199
|
+
### Debugging
|
|
200
|
+
|
|
201
|
+
**Android:**
|
|
202
|
+
```bash
|
|
203
|
+
adb logcat | grep NSD_DEBUG
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**iOS:**
|
|
207
|
+
Look for logs with `NSD_LOG:` in Xcode Console
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Changelog
|
|
212
|
+
|
|
213
|
+
### v1.0.0 (Current)
|
|
214
|
+
- ✅ Fixed iOS server → Android client discovery
|
|
215
|
+
- ✅ Added anti-ghosting IP resolution
|
|
216
|
+
- ✅ Improved cross-platform compatibility
|
|
217
|
+
- ✅ Enhanced logging for debugging
|
|
218
|
+
- ✅ Support for separate discovery/HTTP ports
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
MIT
|
|
225
|
+
|
|
226
|
+
## Credits
|
|
227
|
+
|
|
228
|
+
Developed by Alessandry Cruz for Cappitolian projects.
|