Comments (7)
@bourdakos1 forgot to tell that the startDiscovery
is working as expected
from nearby.
Thanks for verifying! I need to look into how to properly handle this case
from nearby.
Awesome! So it is just a matter of retrying. I'll update this issue to reflect the need for adding internal retry logic for Wi-Fi LAN
from nearby.
Thanks for answering so fast! I will keep subscribed on this issue so we can update the lib on our end :)
from nearby.
It looks like it failed to start listening for incoming connections, but the system didn't return any an explicit errors. My best guess is that the listener transitioned to the nw_listener_state_waiting
which isn't a fatal error, but will end in a fatal nearby error, since we don't attempt retries: https://developer.apple.com/documentation/network/nw_listener_state_t/nw_listener_state_waiting?language=objc
However, I don't have an iOS 14.8.1 device to verify. Do you mind trying to add some logs here:
I can also push an update with more logs if thats easier, but that might take some time to get reviewed/submitted
from nearby.
It looks like your guessing is correct,
from nearby.
I made this workaround
private func startAdvertise(nearbyMessage: NearbyMessage, retryCount: Int) {
print("[NearbyManager] Retrying startAdvertise: \(retryCount)")
guard
let nearbyMessageData = nearbyMessage.dataValue,
retryCount > 0
else {
return
}
advertiser.startAdvertising(
using: nearbyMessageData,
completionHandler: { error in
guard let error = error else {
print("[NearbyManager] Success on startAdvertising")
return
}
print("[NearbyManager] Failed to advertise: \(error.localizedDescription)")
let timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: false) { [weak self] timer in
self?.startAdvertise(nearbyMessage: nearbyMessage, retryCount: retryCount-1)
}
timer.fire()
}
)
}
Eventually it will work:
[NearbyManager] Retrying startAdvertise: 10
[NearbyManager] Failed to advertise: The operation couldn’t be completed. (com.google.nearby.connections.error error 11.)
[NearbyManager] Retrying startAdvertise: 9
[NearbyManager] Failed to advertise: The operation couldn’t be completed. (com.google.nearby.connections.error error 11.)
[NearbyManager] Retrying startAdvertise: 8
[NearbyManager] Success on startAdvertising
from nearby.
Related Issues (20)
- Enable BLE v2 support for iOS HOT 3
- Connectins background Advertisement on IOS HOT 3
- Problem to build on tvOS HOT 1
- Video stream on both Android and iOS HOT 4
- Build fails on latest Linux due to header inclusion change in gcc/clang 13 HOT 16
- Add CocoaPods support HOT 11
- Swift Error scanning BLE Swift HOT 11
- iOS connection error when advertising HOT 15
- Clarification on iOS/Android compatibility and future HOT 26
- What is "//third_party/lexan/build_defs:lexan.bzl" HOT 1
- ConnectionManager is unable to distinguish the same device when discovered multiple times HOT 2
- Can't add library using SPM HOT 13
- [Nearby Connections] [Android] EndpointDiscoveryCallback -> onEndpointLost callback almost never called HOT 3
- Build fails (connections, Arch Linux) HOT 6
- Cross platform connection failure HOT 3
- Possible to expand Build Target to iOS 12? HOT 4
- Data handling & privacy policies
- Wifi Direct for cross platform transferring? HOT 9
- Failed to start discovery with Google Play services 23.34.14 HOT 30
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nearby.