CBPeripheralManager limitations - ios

What are the limitations of the new CBPeripheralManager in iOS 6? If I were crazy enough to implement the FTP (service identifier 0x1106) profile, would I be able to? Or does Apple limit which Bluetooth services an app can expose?
https://github.com/KhaosT/CBPeripheralManager-Demo seems to be a good example of the new types, but I'm not clear on how much is supported at this time, especially since CBPeripheralManager is not even available in the public docs.

#BradLarson was a key helping out with this answer. Kudos to him for all the help in the comments. I'm answering this question just to document what was said for posterity in what I would consider an answer to my perhaps poorly worded question.
The CoreBluetooth iOS framework allows an app developer to use Bluetooth LE, the low energy version of Bluetooth. BLE includes a different set of profiles so services like FTP are not available for it, although some others are. The library should be sufficient to implement these profiles. For example, it should be possible to implement HID over GATT.
For jailbroken devices, the BTStack library can be used to interface with Bluetooth.
A reference I found quite useful to learning about Bluetooth is An introduction to Bluetooth programming.

Related

how to make iOS app connecting with bluetooth?

how to make iOS app with bluetooth?
I need an app which connects and exchange data via bluetooth with other devices, laptop for example.
Many packages for BLE and cant find for classic bluetooth
If you want to use the classic Bluetooth interface of an Apple iOS device, you have to comply with/accept Apple's MFi licensing programme (Made for iPhone/iPod/iPad), which is a major hurdle and the reason for the lack of corresponding libraries.
Short answer: you don't want classic Bluetooth for this. You want BLE. It supports everything you want for this kind of use case. See Core Bluetooth.
Much too long answer about classic Bluetooth and iPhones from my years building earbuds:
Continuing from Risto's answer, even with MFi certification (which requires adding an extra chip to your device, not just licensing), you still don't get general access to the BR/EDR ("classic") interface. You only get access to iAP2, which is an SPP-like serial protocol, but is not SPP. If you're porting from Android, you probably are using SPP, and sorry, that's just not available. You're going to need to switch to BLE.
MFi certification is a useful if you build an audio device that also needs a non-audio control channel. It makes it easy to ensure that both the audio connection and control connection are connected to the same device. This is extremely difficult to do with BLE. But iAP2 isn't a particularly nice protocol, and has weird corner cases. You should not go through the cost and trouble of MFi just to get a SPP-like serial protocol.
On iPhones, access to BR/EDR non-audio profiles is limited to the proprietary iAP2 and GATT over BR/EDR (which is less useful than it sounds since most chips don't support it). Classic audio profiles are limited to what Apple's audio frameworks support, which is not very flexible.
If you make a Bluetooth audio device, have a little extra room on your board, enough margin to add a chip to your BOM, and your SoC supports it, MFi is definitely worth exploring. You can improve the pairing experience marginally and it makes it a bit easier to manage an extra control channel. Plus, you get to add that "Made for iPhone" logo to your packaging. For hearing aids (which I have less experience with), I expect that MFi is a must-have today. From my casual investigation, it looks like it adds some really nice capabilities.
For everyone else, you want BLE.

MFi , CoreBluetooth or External Accesory framework?

I am trying to build an iOS app which would communicate with another non-apple device via bluetooth. It would be a  Bluetooth Stereo Transmitter which uses the bluetooth A2DP-profile which is supported by apple :
http://support.apple.com/kb/HT3647?viewlocale=en_US&locale=en_US
I have read tons of articles and pages. I have many unanswered questions and hope to recieve some answers and write something that will help me and others in future work with iOS and bluetooth.
Evaluating the available bluetooth connection options
Here's a list with possible approaches and informations I found. Please feel free to answer/edit anything that is not correct.
Edited from http://www.pocketmagic.net/2012/07/bluetooth-and-ios-use-bluetooth-in-your-iphone-apps/ :
A) Enroll in the made for iPhone/iPod/iPad (MFi) program. Details on costs are not available, but this is not for the small development companies, barely selling a few licenses.indicate costs depending on project, and starting numbers somewhere at 10K USD. Not really an option IMO, as the costs involved and trouble getting certified are ridiculously high, for something so basic and simple such as building a Bluetooth application. I have found a Bluetooth stereo transmitter with bluetooth version 2.1 (Class II). I can not find if the device is MFi compliant.
Based on this article :
Existing bluetooth device and Apple MFI
Q1: How can I be sure or find out if the device is Mfi compliant?
Q2: If the device is Mfi compliant will I be able to pair it with the device in the settings option?
B) CoreBluetooth framework, currently usable only with Low Energy Bluetooth 4 devices. Since these are not largely spread this is not really an option. You won't be able to connect to standard headsets, keyboards, or other non-Bluetooth 4 devices.
Q3: Will I need to pair the non-apple bluetooth device with my iPad (in settings) to use the CoreBluetooth framework?
I am asking beacuse I have no experience with iOS and bluetooth and beacuse my budget is low, so I dont want to waste money buying stuff I will not be able to use for development.
C) GameKit framework, this allows some basic Bluetooth functionality, such as finding nearby devices and establishing a serial communication link, but it only intended for use between iOS devices. So Android plus iPhone via GameKit is a no go.
D) Private APIs. There is a BluetoothManager framework, in the private APIs, inside the SDK. This can be used to achieve the proposed task, but you won't get your App approved on Appstore, as private API's is not allowed by Apple. Since this is so convenient, and working so nice, almost like the real thing Apple didn't want to include.
Q4: Can I use private APIs within the iOS Eneteprise program and distribute my apps since there is no App store approval process?
Q5: Does anyone know some more private APIs I could use beside bluetoothManager framework?
E)Jailbreaking and using Ringwald's BTStack. Jailbreaking = rooting = freedom, probably the best way to go . But this places you so far away from Apple's guidelines, and the Appstore itself. So better decide what your project is all about, and who your users will be.
Q6: For bluetooth I need CoreBluetooth Framework. What framework do I need to import if I want to use wifi communication?
Thanks for any help :).

Is iOS CarPlay API Public? How to Integrate CarPlay?

Is the CarPlay API publicly available?
Where can we find a programming guide or the reference to these classes if it is?
Or will it integrate seamlessly with other APIs like Audio from AVFoundation?
Notes
This question is broad and may be flagged as so but please do not as though there is almost no information on the subject and a lot of people could find it useful at this stage
I live in Switzerland and want to go to Geneva to try out a demo
app that I would write on a Ferrari lol.
Update Oct, 2019:
A couple of years later, Apple opened up their designer guidelines and developer docs on CarPlay. As mentioned in some other comments as well, getting access to developer tools can be done on your mac as well.
Technically, depending on the type of app you want to be compatible with CarPlay, it requires different API's and frameworks. For example:
The CarPlay framework is for use by navigation apps only. If you want to add CarPlay support to your audio app, use MPPlayableContentManager. For messaging apps, use SiriKit’s Messaging-related intents to support reading and sending messages in CarPlay through Siri. For VoIP calling apps, use CallKit with SiriKit’s VoIP Calling-related intents to make and answer audio calls on a CarPlay system.
Legally, however, still the MFi Program requires application and approval by Apple for you to get the appropriate permissions, signing profile etc. in order to deploy it on an actual device. Let alone release it to market. OR... you can try applying for access manually and explain your case.
Lastly, there is also some documentation on how to enable tools and simulator to work with CarPlay. For example, a small excerpt:
CarPlay is supported by default when you run Simulator. However, you should configure the Simulator with extra options when developing a CarPlay navigation app. To enable extra options, enter the following command in Terminal before launching Simulator: defaults write com.apple.iphonesimulator CarPlayExtraOptions -bool YES.
But besides the documentation I can seriously recommend to read what the people at Flitsmeister blogged about on how to enable tooling on your local machine. Also, their road to finally getting approved was apparently tedious and far from smooth (I'm not affiliated with Flitsmeister), even though their use case is based on having lots of users (±1.5mln). Mentioning this to emphasise: CarPlay is apparently still not for the every day developer, just yet.
This question dates of early 2014. Let me update this with a mid 2016 answer:
TL;DR - No, it is not publicly available.
In order to get the tools, documentation, technical specs and even the license itself to develop for (amonst others) Carplay, you need to be enrolled with Apple's MFi Program.
Apple's MFi Program ("Made for iPhone/iPod/iPad") is a licensing program for developers of hardware and software. This is a specific license targeted at manufacturers, mostly of "mass production" units, that has additional benefits over the regular developer accounts for companies. These benefits include hardware components, tools, docs, techsupport and of course the license that you are allowed to develop specifically for these devices and technologies, like Carplay.
The MFi Enrollment FAQ is a decent read that makes everything pretty clear. But before you get your hopes up, do note that -again- it is only available for manufacturers. Like the FAQ states:
Q: Am I eligible to apply for the MFi Manufacturing License if my company does not own a manufacturing facility?
A: No. The MFi Manufacturing License is intended solely for companies that own one or more manufacturing facilities.
There are some exceptions. For example if you're a contractor, or an engineering design firm, that develops MFi accessories for a client (who is a manufacturer).
But basically put, it is not for the average developer and admission is quite strict. This means, in a nutshell, that Apple Carplay is not available to developer for by the, say, 95% of us.
The MusicCarDisplayUI.framework framework is a private framework as of iOS 7.1. Taking a look at the runtime headers of the framework, one can guess why; it's just not ready yet for wide use. Whether Apple will make it public in the future is one's guess.
In the meantime, make sure to open a feature request or directly contact Apple here.
Update: If you wish to have a CarPlay-enabled app, contact Apple using this form.
Just worked on carplay project.
You can find the api documents on apple's developer website.
Like MPPlayableContentManager and MPContentItem.
However only after registered on apple's website for carplay, will apple send you the "Carplay Programming Guide" telling you how to activate the car simulator and what classes to use and how to do things etc.
Take a look at MediaPlayer Framework. There are a bunch of classes in there designed for CarPlay only. For example, MPPlayableContentManager, MPContentItem, etc. Obviously, you won't be able to deploy it via the AppStore without Apple's approval.
Partially since iOS 12.0 : https://developer.apple.com/documentation/carplay
The CarPlay framework is for use by navigation apps only. If you want to add CarPlay support to your audio app, use MPPlayableContentManager. For messaging apps, use SiriKit’s Messaging-related intents to support reading and sending messages in CarPlay through Siri. For VoIP calling apps, use CallKit with SiriKit’s VoIP Calling-related intents to make and answer audio calls on a CarPlay system.

Transfer pictures from external camera circuit within my iOS app programmatically

I'm working on my senior engineering design project and I need your help! For this I have my iPhone app receiving images from a external camera circuit, which I built.
To interface my iPhone app to the camera circuit, I have looked into the following approaches:
Build a bluetooth module on the camera circuit, to transfer images to the iPhone
Use Eye-Fi SD card to transfer images to my app somehow! link:http://www.eye.fi/products/iphone
Build a circuit, to make a wired connection to the iPhone with the 30-Pin dock connector
Here are the problems I'm facing with each of these. My actual questions for you guys are highlighted in BOLD:
The iOS BlueTooth framework (4S only), only supports Low Energy Devices. Looking at the the modules out there like this one, I'm doubting it will work for image transfer, which seems to be a bulky task for low energy bluetooth. I know there are jailbreak apps on the cydia store, which do regular bluetooth transfers, but I was unable to find those private APIs for such a task. (NOTE: I'm making this app for my purposes, so feel free to suggest any private/unofficial APIs). Question#1: How can I interface to a regular bluetooth device (not another iPhone) and transfer data?
EYE-FI card sounded amazing as a consumer because the company has their proprietary iPhone app to transfer the images from the EYE-FI SD card. Problem is I can't figure out how to easily interface with the EYE-Fi card in my code. I researched the iOS CFNetwork framework, but haven't had any luck. Question#2:How can I interface with the EYE-FI card in my app?
Building a circuit seems simple enough with this development board, but I read somewhere that the iPhone may not recognize an "un-registered" accessory. I have a developer license but not a MFi licence. Question#3: Do I need to be registered as a MFi developer to create and use this external accessory in my App for my own purposes???
You might try setting something up through a serial port since joining the MPi program is prohibited for individuals. You could possible use a connector like this one http://www.amazon.com/neXplug-Ultra-Small-Micro-Adapter/dp/B0055PCVDO/ref=sr_1_1?ie=UTF8&qid=1339309918&sr=8-1
The Apple website recommends individuals/hobbyists to use " recommend that you use a third-party solution which will allow you to connect iOS devices to serial devices and to write iOS apps that communicate with these serial devices" (from mfi.apple.com/faq).
I am also working on an external camera that can hook to the iphone/ipad. I will be using a serial port in order to get around the MFi requirement for external iphone/pad devices. Trying to use bluetooth is too complicated and the data stream isn't big enough for pictures. the wired version will work much better.
I hope this helps and that your college term and project are not already finished. Best of luck.
As T Reddy has already mentioned, if you want to create hardware the interfaces with external hardware framework, you have to sign up with the Apple MFi program which you, as an individual, can not do.
I'm not sure of how the Eye-Fi system works but it sounds to me that it basically syncs the images to their server and once you download their Apple App, the app can sync the photos for you.
Whether you are using Bluetooth or the 30-pin connector, there is no way to interface to an external device unless that device is MFi compliant and a part of the MFi program. I suggest you try the following options to solve this delimma--
If this is a "Senior Project" at some University, see if your University is part of MFi. Apple will not let individuals join the program, so if you are going to gain access, you have to access it through another organization or, possibly, an educational institution. I don't know if Apple has worked with schools in this regard, but you never know. It might be possible.
If your school isn't in the MFi program then you may want to consider re-writing your application for an Android device. Android devices are not locked down like iOS devices, so that may be a more reasonable approach.
I hate to bring bad news but circumventing these hardware restrictions on an iOS device is excessively prohibited. Your options are quite limited and none of them are probably what you either want or need to hear.

iOS receive data from bluetooth and then send information to a database on another server through wi-fi

Which libraries should I look into for the following tasks?
I want to receive a string from another device via Bluetooth (this will require looking at a list of nearby devices and choosing the right one.
I then want to send the String to a database via Wi-fi
This is a simple version of what I actually want to do, but I need to know how to do those things first. Also, any design tips would be greatly appreciated (like having multiple screens, which classes to write, etc).
The ordinary iOS Bluetooth APIs are only available if you enter into Apple's "Made for iPod" program. See MFi Program
If your device can use the newer "low energy" Bluetooth LE, you can look in the corebluetooth framework
There is an example of a Bluetooth LE heart rate monitor program here.
For WiFi, you can use any of several APIs from Apple and others: Berkeley unix sockets, NSURLConnection, CFNetwork, AsyncSocket, etc.
If you mean receive a string from another iOS device, the statement here about needing to be a part of the "Made For iPod" program is incorrect. This would be required if you mean you are trying to build an accessory for iPhone, iPad, or iPod.
The easiest way to "discover" other iOS devices (running your app) and transfer data between them is GKSession from the GameKit Framework. Beam It! is pretty good example code for this.
Once you initialize a GKSession just set a GKSessionDelegate and set the session's available property to YES. Check out the four required GKSessionDelegate methods and the Beam It! sample code.
http://arctouch.com/beamit/ //Beam It! code
Your best bet is to study Apple's WiTap sample app. That will answer your question #1. For question 2, you can use Apple's coredata. If you are not familiar with coredata, check out this site's tutorials.

Resources