SUMMARY

This chapter has demonstrated how easy it is to connect two iOS devices using Bluetooth. Using the concepts shown in this chapter, you can build networked games and other interesting applications easily. You also saw how the Game Kit framework provides the GKVoiceChatService class, which makes voice communication between two devices seamless. It is not necessary to understand how the voices are transported between two devices — all you need to know is how to call the relevant methods to initialize the chat. However, there is one important thing you should know: Voice chat works not only over Bluetooth, but over any communication channel. In fact, if you have two devices connected using TCP/IP, you can stream the voices over the wire.

EXERCISES

  1. What class can you use to locate peer Bluetooth devices?
  2. Name the object that is responsible for managing the session between two connected Bluetooth devices.
  3. Name the method from the GKVoiceChatService class that you need to call to establish a voice chat.
  4. Name the two methods defined in the GKVoiceChatClient protocol that establish a voice chat channel.

Answers to the exercises can be found in Appendix D.

image WHAT YOU LEARNED IN THIS CHAPTER

TOPIC KEY CONCEPTS
Looking for peer Bluetooth devices Use the GKPeerPickerController class.
Communicating between two Bluetooth devices Use the GKSession class.
Establishing a voice ...

Get Beginning iOS 5 Application Development 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.