Can an iOS7 device act as an iBeacon and figure out when other iOS7 devices come in its range? Do those other iOS7 devices need to have Bluetooth turned on?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
As mentioned, an iOS 7 device can act as an iBeacon, so long as it Bluetooth LE technology.
http://support.apple.com/kb/HT6048
One point that didn't come out clearly from the previous answers is that in order for the publishing to work (for example in David's answer's Phone A) the application that started publishing must be in foreground.
From the Apple documentation:
An iOS device with BluetoothLE can act as an iBeacon yes.
Check out the AirLocate example code at https://developer.apple.com/downloads/index.action?name=WWDC%202013#
Being an iBeacon doesn't give feedback about devices that come into range so you'd have to implement that yourself. ie you'd have to have the devices that detect the iBeacon then tell the iBeacon they'd seen it through some other means.
Yes, an iOS device can act as a beacon, from iPhone 4s and up (Bluetooth 4.0 required).
You publish a beacon by passing the dictionary from
[CLBeaconRegion peripheralDataWithMeasuredPower:]
to[CBPeripheralManager startAdvertising:]
.Publishing a beacon will not give you any feedback on devices, you'll have to scan for others publishing a beacon.
As for backgrounding, you can not publish a beacon in the background, your app needs to be running in the foreground for that. Scanning is possible in the background.
Yes, an iOS7 device can act as an iBeacon. You can do exactly what you are suggesting if you have an app installed on all phones, and you also write a web service. This would allow phone A to see phones B and C when they are nearby:
All phones would need Bluetooth LE, have it turned on, and have your app installed. They would also need internet connectivity to call the web service.
If you're not set on using iBeacons, this project uses Bluetooth LE to share an array of ids between nearby phones- SimpleShare
You could set an ID for the user of each phone, share them between the phones over Bluetooth LE using the SimpleShare project (even while in background mode), and then query a web service to find out more information about the user with that ID.