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



我想实现一个语音&网络下两个iOS开发人员之间的文本聊天变得可能是可能的。我不需要语音通话设施,例如Linphone或Siphone等任何手机。我已经研究了它们&对我来说太复杂了。有什么简单的SDK可以使此事成为可能吗?

顺便说一句,可以通过电子邮件验证来完成用户识别..

我认为使用XMPP框架做到这一点的最佳方法。使用XMPP您可以发送文件&给他人发短信。使用它,您可以录制语音消息&发送它。有一些链接:

XMPP聊天的GitHub项目链接

构建iOS的jabber客户端:XMPP设置

希望它对您有所帮助。

编辑:

Apple的Gamekit Framework提供了您需要在游戏中实现的Evertyhing。

完整的文档在这里:

http://developer.apple.com/library/ios/#documentation/networkinginternet/conceptual/gamekit_guide/addingvoicecechattoamatch/addingvoicechattoamatch/addingvoicechattoamatch.htmatch.htmath.htmath.htmath.htmll#/-

假设您已经将应用程序已将应用程序连接到使用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;
}

最新更新