Take the 2-minute tour ×

What the API uses for work with plug devices, something like this app: square iphone scanner ?CocoaTouch, some from Foundation?

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

Square works through the headphone jack, so it doesn't use the External Accessory framework. External accessories on the iPhone are notoriously difficult to do, which is why barely any manufacturers are creating products.


I can count on one finger the number of third party devices I've seen that communicate through the dock connector on the iPhone.

share|improve this answer
add comment


Oops. Square doesn't use ExternalAccessory, but some kind of custom interface through the headphone jack, as explained by @kubi.

The relevant interface looks like this:

@interface SKSquareInterface : NSObject {
    ? delegate;
    ? queue;
    ? state;
@property(assign) ? XXEncryptedProperty_6b644;
@property(assign) ? XXEncryptedProperty_6a1bc;
@property(assign) ? XXEncryptedProperty_77a22;
@property(assign) ? XXEncryptedProperty_77a39;
@property(assign) ? XXEncryptedProperty_77a60;
@property(assign) ? XXEncryptedProperty_77800;
@property(assign) ? XXEncryptedProperty_7780c;
-(?)_listenForSwipe:(?)swipe numSamps:(?)samps;

which suggest it directly parse the input from AudioQueue.

share|improve this answer
add comment

Please read http://www.eecs.umich.edu/~prabal/pubs/papers/kuo10hijack-islped.pdf to understand how to use the headphone jack to modulate/demodulate information. Square is not a 30-pin connector accessory.

share|improve this answer
add comment

Your Answer


