3

I am building an iOS app that sends small pieces of data, some personal information like: Name, Phone, Facebook profile between nearby device. I have been researching for about 2 weeks if there's a good way to send data between iOS - iOS / iOS - Android devices. The first approach I started working on was the bluetooth as the most obvious and logical way to connect to someone nearby , of course when the app is launched on both sides. I read and tested the CoreBluetooth framework that Apple provides, but it never found any android devices nearby ( I mean the RSSI, MAC address and name of the device ).

So, what would be the most proper and universal method for creating this functionality ? I am starting to think that the answer is - through internet connection, but I am kind of lost in all the information in StackOverflow and the net at all. Any proper advice / solution / sample code will be greatly appreciated. As I said , I am only aiming to send few strings between two smartphones and I am writing the iOS app in Swift.

Thanks

xdevx32
  • 160
  • 9

1 Answers1

3

You'll need to use Bluetooth 4.0, aka Bluetooth Low Energy, or BTLE, or BLE. On iOS this has been supported since iOS 6 and doesn't require any special approval (i.e. Apple's MFI program doesn't apply). I have no idea about availability on Android (I assume it's available in at least some cases, depending on the version of Android and the capabilities of the Android device).

BTLE is designed around the idea of one device being a "central" node that can communicate with multiple "peripheral" nodes. You would need to work out how your app will chose modes to communicate.

Apple provides the Core Bluetooth framework to support BTLE. There's extensive documentation of the framework. Apple also provides a sample project that demonstrates how to use both the central and peripheral modes. On the iOS side, once the devices discover each other, you can read/write NSData blobs that can contain whatever bytes you need.

BTLE is an open protocol, so it should work on both platforms, but I can't provide any Android info.

Tom Harrington
  • 69,312
  • 10
  • 146
  • 170
  • Thanks for your answer ! It perfectly solves my problem on the iOS side, but I am still need a global solution for Android an iOS. Take care – xdevx32 Dec 02 '15 at 18:56