I need to know the Bluetooth MAC address of an iOS device, is there any way this data is accessible?
The purpose would be to identify when any user gets near that Bluetooth device.
In case this isn't possible in any way, what alternatives should I take into account?
No this is not possible with iOS public APIs
Related
I would like to build an IPhone app that should check the identity of a BT device, by name or MAC.
If the device is not part of the MFI programme what profiles should the device support in order for an IPhone app to connect to it and validate its MAC or name ?
Cheers,
Ionut
I'm not sure you need to connect to something to get a MAC address or a name. My coworker's iphone seems to see all other bluetooth devices in our work area and displays the names, it just won't connect to them. And I'm sure it gets the MAC before it gets the name, but avoids displaying it to the user because names are a lot more friendly.
I do know that with android and blackberry, you actually use MAC addreses as your basic internal identifier, and only pull out the name when you want to identify your remote devices to the user.
If you really do need to make a connection from iOS to non MFi bluetooth radio, the advanced audio distribution profile (A2DP) would do what you want. There's a product out there I've seen that is a bluetooth controlled power board, and it used audio pulses being transmitted over A2DP to get around MFi requirements. Though you should reconsider this approach because it's problematic for a non audio device to advertise an audio profile. And this fake audio device will get seen by by a lot more than your application.
If you're happy to only work with iphone 4s and above, I've also heard rumours that bluetooth LE(4.0?) devices are not required to have the apple verification chip... but haven't really looked into it
After searching on Google, I found that people say it's only possible to connect an iOS device with a non iOS device with the 'MFi program'. Is that true?
My project is mainly focused on sending and receiving information with the Arduino device via Bluetooth directly.
Is communication between iOS and non iOS devices without jailbreak possible? If yes, is there a reference?
(I viewed Stack Overflow question How can an iPhone access another non-iPhone device over wireless or Bluetooth?.)
As I stated in the above-linked question, general Bluetooth communication to external devices on non-jailbroken iOS devices is restricted to MFi-compliant Bluetooth hardware.
However, newer iOS devices (iPhone 4S, new iPad) are capable of Bluetooth 4.0 LE communication with external devices without the need for those devices to be MFi-compliant. This interaction is done through the new Core Bluetooth framework, which lets you send and receive arbitrary data to and from Bluetooth LE devices. This only works with those listed newer iOS devices, though.
Tim points out an interesting hack that you might be able to get away with in making your device appear like a Bluetooth HID keyboard. Devices like this barcode scanner have special modes to appear as HID devices to iOS. You might be able to pull something together based on this, but all data transfer will be one-way from your device, and it looks like this will require entering that data into text fields as if you had a keyboard connected.
Alasdair Alan's "iOS Sensor Apps with Arduino" is a good resource to look at. I've used Wifi with another microprocessor (mbed) but not sure about bluetooth. Alasdair is active on Twitter and he usually is kind enough to answer questions.
What are the limitations of the Bluetooth on iOS? Can I program a Bluetooth in a way it makes the discovery procedure to find neighbor devices, selects a device from list, pair with it and starts over sockets exchanging some data (e.g. for peer2peer game? Is that possible?
All hardware that can communicate with iOS devices using Bluetooh must comply with the MFI (made for iPhone) program. It requires the vendor to use certain kinds of hardware and require a device certification. The program is under a strict NDA.
It basically means that you can only make a connection between iOS devices or devices with the MFI label and not just connect to a another cellphone -unless your iOS device is Jailbroken of course.
yes it is possible. BTW only iOS devices are supported.
Take a look at GameKit framework in the documentation.
I've been trying to find examples on communicating with bluetooth devices on iOS and have been coming up short. As I understand it SPP is not yet supported. At the simplest level, I'd like to send a simple 1 or 0 signal to the bluetooth device I'm creating. (It's a bluetooth switch that would turn something on and off). Is there a way to cleverly do this through the HID or HFP profiles?
The short answer to your question is that you can't connect to an arbitrary Bluetooth device you may happen to have, you can only connect to a Bluetooth device that has come through Apple's licensing program (i.e. the "Made for iPod/iPhone" label). From Apple's documentation:
Q: [The External Accessory framework allows] my application to communicate with Bluetooth devices. So why doesn't my application see the Bluetooth accessory sitting next to my iPhone?
A: The External Accessory framework is designed to allow iOS applications to communicate only with hardware accessories that are developed under Apple's MFi licensee program.
So there is no public API for accessing an arbitrary Bluetooth device from within iOS: you have to go through the External Accessory Framework to communicate via Bluetooth, and the EAF's mission is "communicate with MFi devices," not "communicate with arbitrary external devices." A sufficiently ingenious developer could probably hack something in there, but -
it's a non-trivial undertaking
you are spectacularly unlikely to get past the App Store approval process
So there's just not much percentage in it - the effort of doing so is unlikely to reward you.
If there already exists an MFi device that can be coerced into doing something that you want, that's probably your best chance - short of going through the MFi approval/licensing process yourself, of course. If you want to do so, have at it and good luck.
I'm answering this question late because Zeroxide's answer is incorrect (you can use a random Bluetooth keyboard with your iOS device because Apple implemented that connection, which is different from giving you a public API path to doing likewise) and I find Rokridi's answer to be incomplete-though-headed-in-the-right-direction.
Edit: A caveat has since been added to the linked Apple page about Bluetooth Low-Energy devices. So there's a loophole, but it's not a big one because very, very few Bluetooth LE devices have actually been produced as yet.
As far as i know, if your external device is non iOs device then you should use External Accessory Framework to communicate your application with it. Threfore, you external device should be certified by Apple through the Made for Ipod program (MFI). Hope this helps.
If you want to use classic Bluetooth (not BLE), then you have to first PAIR the iOS device to the Bluetooth device (in Settings). If you can't do that then you can't communicate with it with your app.
NO. whether device is MFi certified or not, you can connect device to iphone if bluetooth profile is HFP, or HID's (ordinary profiles. not iAP profile). Think about bluetooth headset or keyboard. does it need MFi mark on it to use? NO. Never.
I need to know the MAC address or bluetooth device name of other devices near an iPhone. is this possible with the regular API?
With iOS 5 on the iPhone 4S, it is possible to detect Bluetooth Low Energy devices (which hardly exist yet). It's not possible with regular APIs. You can use BTstack.org if you consider Jailbreaking your device.