Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send files to other iPhones via Bluetooth

I'm doing a little app to allow users to edit and share text fast on the iPhone.

So I know a little of Bluetooth programing for iPhone, but I'm not able to do what I want to do:

  • The text of the app is saved in NSUserDefaults. I want to send this to another iOS device by the key: "Text1", "Text2" or "Text3"( I know that I have to convert the text that will be in a string to NSData, and tren I would like to have it in a NSMutableDictionary with its key)

  • I also want to be looking for new iOS devices arround all the time.

Please help me because I don't know how I can do it and it's so hard to find tutorials of iPhone Bluetooth programming, thank you!

like image 417
adr Avatar asked May 11 '12 18:05

adr


1 Answers

Use GameKit, there are many tutorials.

Use this to find other devices:

GKPeerPickerController *picker = [[GKPeerPickerController alloc] init];
picker.delegate = self;
picker.connectionTypesMask = GKPeerPickerConnectionTypeNearby;
[picker show];
like image 118
Eric Avatar answered Oct 11 '22 14:10

Eric