Hello,
I would like to know if anyone has or still using the GKVoiceChat capabilities in their apps. I wanted to use it for my online game but I am coming across issues using it and wondering if their are alternatives?. The documentation mentions to use Share-play but that wont be possible with random online players. Any help will be appreciated!.
Post
Replies
Boosts
Views
Activity
Hello,
has anyone been able to implement in their game a way to display the number of players currently online in their game?. I thought up of this feature and thought it will be useful for players to find out if there is anyone currently online so that they don't waste their time trying to find a random online match. Any help will be greatly appreciated.
Kind regards,
Jabir Abdi
Hello,
I am trying to submit my app to the app store and I want to make sure that my app is only installed by iPhones with a true depth camera. I have tried including the "iPhone / iPad Minimum Performance A12" in the the minimum required devices capabilities tab in info.plist but it seems to not work. I can still open my app with a phone that does not have the true depth camera.
Is there a way of setting the minimum requirement to have the true depth camera through the info.plist or can I also hard code it in my app?. Your assistance is greatly appreciated.
Hello,
First of all, I understand that GKVoiceChat has been deprecated and replaced by shareplay but for my situation, it does not seem useful as I will be matching with the random players hence I can not utilise the Facetime(Shareplay) capability.
I have set up a voice chat function using the GKVoiceChat object, my game connects with another player successfully but the voice chat does not work for some reason. The code snippet below is how I implemented it with the help of the tutorial from : apple (Start Voice chat between players)
class OnlineGame {
var voiceChat: GKVoiceChat? = nil
...
// When online game succesfully connected and game view loaded
self.startVoiceChat()
func startVoiceChat() {
// Handle an unknown, connected, or disconnected player state.
/// - Tag:voiceChatChangeHandler
///
if voiceChat == nil {
// Create the voice chat object.
voiceChat = myMatch?.voiceChat(withName: "Gamesession")
}
let voiceChatChangeHandler = { (player: GKPlayer, state: GKVoiceChat.PlayerState) -> Void in
switch state {
case GKVoiceChat.PlayerState.connected:
self.voicechatstate = 1
case GKVoiceChat.PlayerState.disconnected:
self.voicechatstate = 2
case GKVoiceChat.PlayerState.speaking:
self.voicechatstate = 3
case GKVoiceChat.PlayerState.silent:
self.voicechatstate = 4
case GKVoiceChat.PlayerState.connecting:
self.voicechatstate = 5
@unknown default:
print("Player unknown state.")
}
}
// Exit early if the app can't start a voice chat session.
guard let voiceChat = voiceChat else { return }
// Handle an unknown, connected, or disconnected player state.
voiceChat.playerVoiceChatStateDidChangeHandler = voiceChatChangeHandler
// Set the audio volume.
// Activate the shared audio session.
do {
let audioSession = AVAudioSession.sharedInstance()
try audioSession.setCategory(AVAudioSession.Category.playAndRecord, mode: AVAudioSession.Mode.gameChat, options: AVAudioSession.CategoryOptions.allowBluetooth)
try audioSession.setActive(true, options: [])
}
catch {
print("ERROR: \(error.localizedDescription).")
}
voiceChat.volume = 0.8
voiceChat.start()
voiceChat.isActive = true
}
}
Thats my implementation of it and hope it explains my issue. Thanks for your assistance in advance!.
Hello,
I am building an app that requires players joined to an online game session and to have a video chat with both of their front cameras turned on. I currently know that GameKit supports the voice chat option but could not find any source for video chat. Is it possible set up a video chat on an online game session?. What libraries can I use that have support in implementing the video chat (AVFoundation) ?
Your assistance is greatly appreciated.
Hello, Based on following the sample code for Draw together to check whether a group session is eligible, I just had to make a State object for Group state observer and use GroupStateObserver().isEligibleForGroupSession as a boolean but it always return false. I checked the documentation and it requires to configure a subscriber but don't see it in the sample code. Am I missing something?. Any help will be really appreciated.