如何实现两个iOS设备之间的语音和文字聊天

我想实现一个应用程序,通过这个应用程序,networking中两个iOS设备之间的语音和文本聊天成为可能。 我不需要像LinPhone或SiPhone这样的手机的语音通话function。 我研究过他们,发现对我来说太复杂了。 有没有简单的SDK来使这成为可能?

顺便说一下,用户身份validation可能通过电子邮件validation完成….

我想用XMPP框架来做一个最好的方法。 使用XMPP,您可以将文件和文本发送给其他人。 使用它可以录制语音信息并将其发送。 有一些链接:

XMPP聊天的GitHub项目链接

构build适用于iOS的Jabber客户端:XMPP设置

希望对你有所帮助。

编辑:

苹果的GameKit框架提供了你需要实现游戏内聊天的过程。

完整的文档在这里:

http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/AddingVoiceChattoaMatch/AddingVoiceChattoaMatch.html#//apple_ref/doc/uid/TP40008304-CH11-SW11

假设你已经将应用程序连接到一个或多个使用GameKit的其他玩家,你可以开始语音聊天,如下所示:

-(void) startInGameChat { //Set up audio session AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:myErr]; [audioSession setActive: YES error: myErr]; GKMatch* match; GKVoiceChat *teamChannel = [[match voiceChatWithName:@"redTeam"] retain]; GKVoiceChat *allChannel = [[match voiceChatWithName:@"allPlayers"] retain]; //Start the chat [teamChannel start]; //Enable Mic teamChannel.active = YES; }