Post

Replies

Boosts

Views

Activity

NISession Background Apple Shareable Configuration Data in IOS 16
var peerIdentifier = peripheral!.identifier     do {       configuration = try NINearbyAccessoryConfiguration(accessoryData: accessoryData, bluetoothPeerIdentifier: peerIdentifier)     }catch{       return     }     cacheToken(configuration!.accessoryDiscoveryToken, accessoryName: devicename)     nisession?.run(configuration!) I configured the source as above, how do I receive Apple Shareable Configuration Data sessionFailed : Error Domain=com.apple.NearbyInteraction Code=-5887 "NIERROR_SESSION_FAILED_DESCRIPTION" 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.}
5
0
1.5k
Jul ’23
background TWR Session Respose in myapp
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.}
1
0
1.2k
Sep ’22