1

我想实现一个应用程序,通过它可以在网络下的两个 iOS 设备之间进行语音和文本聊天。我不需要像 LinPhone 或 SiPhone 这样的任何电话的语音通话功能。我研究过它们,发现对我来说太复杂了。有没有简单的SDK可以做到这一点???

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

4

1 回答 1

1

I think one best way to do it using XMPP Framework. Using XMPP you can send files & text to other persons. Using it you can record voice message & send it across. There are some links for it:

GitHub Project Link for XMPP Chat

Building a Jabber Client for iOS: XMPP Setup

Hope it helps to you.

EDIT:

Apple's GameKit framework provides evertyhing you need to implement in-game chat.

The full documentation is here:

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

Assuming you have allready connected the App to one or more other players using GameKit, you can start the voice chat like so:

-(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;

}
于 2012-11-06T12:35:04.123 回答