which one is better for implementing chat for the iPhone with users in the current are开发者_如何学Ca
gameKit or bounjour ?
Bonjour is simply service discovery over the network, it has nothing to do with actually transferring data.
Gamekit makes use of Bonjour under the hood to discover other clients, and then provides extra APIs ob top of bonjour to transfer data between clients.
Game Kit. Because it builds on top of Bonjour to find those other players and then provides an API to communicate with them. Check out the documentation.
Using GameKit limits you to iOS/Mac devices. Bonjour is open source and available for Android and Windows.
My vote is on GameKit. Not only does it allow you to send arbitrary data, but you can set up a voice chat with about two API calls.
var chat:VoiceChat = match.getVoiceChat("all");
// join the voice chat so the player can hear other players chat.join();
// set talk to true so other players can hear this player chat.talk = true;
Note: The above is using a Native Extension for as3, but it's basically the same API on iOS.
GameKit is fine for games, but keep it in your mind that Apple may not allow you to use GameKit features for non-game apps.
精彩评论