Closed EnricoGiordano1992 closed 5 years ago
check that result.action == 'resolved'
?
At first time, when plugin find a device, it gives me action == "resolved", but second time that I use it, it gives me only action == "added".
by second time does it mean you 'paused' the app and then you resumed it? or you left if for good and then reopened it?
does ionViewDidLoad
is call again on resume?
No, I mean that I change page the I return in the page that I call zeroconf plugin. Yes, ionViewDidLoad is called again.
Just ran into the same problem. action == "resolved" is only returned on the first watch attempt. Any consecutive watch just returns action == "added". zeroconf.unwatch() does not seem to help. But after zeroconf.stop() I once again receive another action == "resolved".
(Android 7.1.2 / cordova-android 6.3.0)
We recently introduced a reInit() method to help with situations where watches may potentially be duplicated. This method reverts the plugin almost completely to its initial state. Any chance you could try this and report the outcome?
I'm running into this problem, I think.
reInit()
doesn't seem to help, and sometimes even reloading the app doesn't seem to change anything either... In fact, it seems that if I start my service and register it before launching the app, I only receive the "added" events without the IP addresses.
Interestingly, I only had this problem when running on the ad-hoc wifi of my android device; when both the device and my service are running on a local wifi network it seems to work just fine.
@shader can you cast some light on your network topologies for both working and non-working scenarios? I'd ask if you can discover your services with a third-party Bonjour browser tool, but it sounds like you can as "running on a local wifi network" works fine. I might suggest ad-hoc-ing your phone to a computer and running the Bonjour browser tool to test.
@becvert I wonder if the OS is having trouble resolving IP addresses when using a particular network adapter configuration. Could this be caused by lack or presence of DHCP?
@emcniece I have no idea :confused:
Closing old issue. Feel free to reopen.
Hi becvert, I've a problem using your plugin with Android device. In particular, I receive, on "watch", event without ipv4Addresses; at first call, I can simply check if service does not contain ipv4Addresses (because I receive duplicate service, one with ipv4Addresses, one without ipv4Addresses). When I go out and return in a app page that use zeroconf, it returns only service without ipv4Addresses. How can I resolve this? This is my code:
I'm using Ionic (3.13.0 but same problem with previous versions), tested on Samsung Galaxy S4 (Android 5.0.1) and Wiko Fever (Android 6.0). Thanks for help!