Creating a peer-to-peer bluetooth network

In this recipe, we will create a peer-to-peer bluetooth network, which we will use to exchange text messages. To create a bluetooth peer-to-peer network, we will use Apple's Game Kit framework. So, we will need to add the Gamekit framework to our project.

The downloadable code for this project creates a peer-to-peer network that is used to exchange text messages. Each individual message that is sent over the bluetooth network can have a maximum size of 90 KB. If the data that we are sending is greater then 90 KB, we will need to break the data apart and send it as multiple messages.

We will be implementing the GKPeerPickerController and GKSession delegate methods. The GKPeerPickerController method provides ...

Get iOS and OS X Network Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.