omergul / Discovery

A very simple library to discover and retrieve data from nearby devices (even if the peer app works at background).
Apache License 2.0
418 stars 34 forks source link

Devices aren't seeing each other #25

Open tmandry opened 8 years ago

tmandry commented 8 years ago

I haven't been able to discover anyone nearby, testing with 3 different devices (iPhone 5, 6, and 6 Plus) on the example app. Haven't changed anything.

There don't seem to be any interesting logs, except occasionally Received memory warning. On each device log I see this message repeated:

2015-10-05 13:28:37.027 DiscoveryExample[11294:1566532] Updating table view with users count : 0

but it only starts when I go home and reopen the app. In any case I can't get any of the devices to see the other.

AndrewTSwann commented 8 years ago

I'm having the same problem, did you find a solution? iPhone5 and iPhone6S both with iOS 9.2.1.

AndrewTSwann commented 8 years ago

I found my problem. The solution was described in issue #21, use the following code in Discovery.m: initWithUUID: self.shouldAdvertise = NO; self.shouldDiscover = NO;

switch (startOption) { case DIStartAdvertisingAndDetecting: self.shouldAdvertise = YES; self.shouldDiscover = YES; break; case DIStartAdvertisingOnly: self.shouldAdvertise = YES; break; case DIStartDetectingOnly: self.shouldDiscover = YES; break; case DIStartNone: default: break; }