In my app, I have configured BackGround Session like the following code.
var peerIdentifier = peripheral!.identifier do { configuration = try NINearbyAccessoryConfiguration(accessoryData: accessoryData, bluetoothPeerIdentifier: peerIdentifier) (configuration!.accessoryDiscoveryToken.description) : (devicename) : (peerIdentifier)") }catch{ return } cacheToken(configuration!.accessoryDiscoveryToken, accessoryName: devicename) nisession?.run(configuration!)
However, the Delegate setting does not receive a response whether it is an error
func session(_ session: NISession, didUpdate nearObjects: [NINearbyObject])
-
Is there a way to receive NINearbyObject in the background?
-
If not, is there a way to get a sample code on how to measure the background distance?
-
When using 'nisession.delegate = self ' in background
UserInfo={NSLocalizedRecoverySuggestion=NIERROR_SESSION_FAILED_RECOVERY_SUGGESTION, NSLocalizedDescription=NIERROR_SESSION_FAILED_DESCRIPTION, NSLocalizedFailureReason=This session object is invalidated. Dispose of it and create a new one instead.}