Push To Talk

RSS for tag

Let people send and receive audio in your app with the push of a button.

Posts under Push To Talk tag

18 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

iOS Push to Talk Framework Not Working in Archive Build (Flutter)
I have developed an app using Flutter that utilizes the Push to Talk framework on iOS. The Push to Talk feature works perfectly in debug mode, but after archiving the build and installing it on an iOS 17 device, the Push to Talk functionality stops working. Here are the steps I have already taken: Enabled background modes. Enabled Push to Talk capabilities. Despite these settings, the issue persists in the archive build. Has anyone else encountered this issue? What additional steps or configurations are required to get Push to Talk working in the archive build on iOS 17? Any help or guidance would be greatly appreciated. Thank you!
1
0
37
5h
Concurrency Crash - PushToTalk Framework
With the integration of Apple's pushToTalk framework - we create the PTChannelManager using its async initializer from AppDidFinishLaunching - using an actor to ensure the PTChannelManager is only created once. With this we have been seeing a lot of crashes for users in our analytics dashboards happening about ~2 seconds after app launch around a task-dealloc. Here is a simplified version of our actor and Manager - where the manager just shows the init. The init of it is an async optional init because the creation of the PTChannelManager uses an async throws. actor PushToTalkDeviceContainer { private var internalPushToTalkManagerTask: Task<PushToTalkManager?, Never>? func pushToTalkManager() async -> PushToTalkManager? { #if !os(visionOS) if let internalPushToTalkManagerTask { return await internalPushToTalkManagerTask.value } let internalPushToTalkManagerTask = Task<PushToTalkManager?, Never> { return await PushToTalkManagerImp() } self.internalPushToTalkManagerTask = internalPushToTalkManagerTask return await internalPushToTalkManagerTask.value #else return nil #endif } } public class PushToTalkManagerImp: PushToTalkManager { public let onPushToTalkDelegationEvent: AnyPublisher<PushToTalkDelegationEvent, Never> public let onPushToTalkAudioSessionChange: AnyPublisher<PushToTalkManagerAudioSessionChange, Never> public let onChannelRestoration: AnyPublisher<UUID, Never> private let ptChannelManager: PTChannelManager private let restorationDelegate: PushToTalkRestorationDelegate private let delegate: PushToTalkDelegate init?() async { self.delegate = PushToTalkDelegate() self.restorationDelegate = PushToTalkRestorationDelegate() self.onPushToTalkDelegationEvent = delegate.pushToTalkDelegationSubject.eraseToAnyPublisher() self.onPushToTalkAudioSessionChange = delegate.audioSessionSubject.eraseToAnyPublisher() self.onChannelRestoration = restorationDelegate.restorationDelegateSubject.eraseToAnyPublisher() do { ptChannelManager = try await PTChannelManager.channelManager(delegate: delegate, restorationDelegate: restorationDelegate) } catch { return nil } } } The crash stack trace is as follows: 0 libsystem_kernel.dylib 0x00000001e903342c __pthread_kill + 8 (:-1) 1 libsystem_pthread.dylib 0x00000001fcdd2c0c pthread_kill + 268 (pthread.c:1721) 2 libsystem_c.dylib 0x00000001a7ed6c34 __abort + 136 (abort.c:159) 3 libsystem_c.dylib 0x00000001a7ed6bac abort + 192 (abort.c:126) 4 libswift_Concurrency.dylib 0x00000001ab2bf7c8 swift::swift_Concurrency_fatalErrorv(unsigned int, char const*, char*) + 32 (Error.cpp:25) 5 libswift_Concurrency.dylib 0x00000001ab2bf7e8 swift::swift_Concurrency_fatalError(unsigned int, char const*, ...) + 32 (Error.cpp:35) 6 libswift_Concurrency.dylib 0x00000001ab2c39a8 swift_task_dealloc + 128 (TaskAlloc.cpp:59) 7 MyApp 0x0000000104908e04 PushToTalkManagerImp.__allocating_init() + 40 (PushToTalkManager.swift:0) 8 MyApp 0x0000000104908e04 closure #1 in PushToTalkDeviceContainer.pushToTalkManager() + 60 9 MyApp 0x00000001041882e9 specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 (<compiler-generated>:0) 10 MyApp 0x0000000103a652bd partial apply for specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 (<compiler-generated>:0) 11 libswift_Concurrency.dylib 0x00000001ab2c2775 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1 (Task.cpp:463)
2
0
86
1h
Push to talk block Audio session
I'm facing an issue where I can't play an audio file stored in my project after receiving a push-to-talk notification. Strangely, I'm able to play the audio file by tapping on a button before receiving the push notification, but it doesn't work afterward without any error messages. I've ensured that I've set up everything correctly in my project's capabilities. Any insights on what might be causing this issue would be greatly appreciated. I set everything in capabilities Set permission in .plist Request permission in app delegate I make connection to the room when app becomes active and received succes Then I setup .halfDuplex for this channel In restoredChannelUUID I activate AVAudioSession After sending the ppt push, I parse speaker and make it activeRemoteParticipant. I see than delegate function channelManager didActivate works good Where I tried to play audio from my player I see this prints in console, but no sound play
3
0
425
Mar ’24
What is expected behavior of apple when uninstall application while joining PTT channel?
Hi. I'm fixing issue of my push to talk app behavior. While I'm joining Push To Talk channel, then I uninstall application, application does not exist but system shows PushToTalk status in status bar with blue button. I want to automatically leave channel after uninstall app, but now I cannot handle this behavior. If there is some expected behavior of apple, I want to know it but I cannot find their expectation in any document. Does anyone know it? best regards.
1
0
272
Mar ’24
PTT in the background, cannot activate Siri without unlocking
Hello, We're interested in using the PTT Framework with our PTT capable hardware, as the framework has intended. The problem is activating Siri with any of our specified Intent's doesn't work when the phone is locked. The iPhone always says "You'll have to unlock your iPhone first". Reading up on the problem, it seems pretty common in the fact that Apple doesn't allow Siri Intents to be executed while the phone is locked. It's a sensible precaution by default, but there are countless threads of real use cases that users want to use Siri without unlocking (with PTT, or well, without). There appears to be no options for PTT to enable this, any flags on the Siri Intent to allow benign App actions or queries, user UI configuration through Settings -> Siri & Search to manually allow it even when the phone is locked. Neither are there any entitlements (that I'm aware of) that would allow trivial and non-secure Siri App Intents. The only advice we have for our users (and albeit against the intention of the limitation in the first place) is to: Disable Auto Lock, Disable Face ID and to Disable Passcode. It is in fact 2024, and users do expect a better experience than this with Siri, or am I missing something?
1
0
409
3w
Push To Talk - integration with Android
Hello, I am approaching the recent PTT Framework as my desire is to create a Walkie Talkie app. I watched the video and followed the documentation. I haven't managed to get it working yet, as there are some steps that aren't 100% clear to me. But the biggest doubt right now is: if I manage to create a walkie talkie App that works with PTT Framework on SwiftUI, will I be able to integrate this functionality in some way with the Android version of the same App? I don't know if it's worth mentioning but my backend right now is Firebase.
2
1
421
Mar ’24
Push to Talk framework failing state after restart
Our PTT framework app works great but we have now found an interesting scenario where you can get the PTT Framework in a state that is non functional. Here's how it can be reproduced: Start your PTT app ( With PTT framework ) Successfully joined channel and we can transmit and receive incoming transmits. Put app in background. ( PTT framework/GUI symbol present in top) Wait 1 min Restart phone by pressing volume up + right side button Wait 1 min Start phone We can now get two scenarios: "Sceanario *1": In 4 of 5 cases the PTT framework symbol will be present directly when phone is started. If we here start running our app we can see that the channel is restored and everyting works perfectly. "Sceanario *2": In 1 of 5 cases the PTT framework symbol is not present after phone is started, and will not be even if waiting. If we here start running our app we can see that the channel is also here restored (channelDescriptor(restoredChannelUUID channelUUID: UUID) -> PTChannelDescriptor) and we can successfully call "mgr.setTransmissionMode(newTransmissionMode, channelUUID: self.channelUUID)" on our channel ( PTT framework symbol still not present !!!!) If we now try to call "requestBeginTransmitting(channelUUID: UUID)" we will get the PTChannelError error channelNotFound !!!! We are then reacting to this and trying to do leave the channel "leaveChannel(channelUUID: UUID)" but also this is returning PTChannelError error channelNotFound in "channelManager(_ channelManager: PTChannelManager, failedToLeaveChannel channelUUID: UUID, error: Error))" !!!! The interesting thing here is that my log is saying the following: PTTFrameworkImpl: failedToLeaveChannel 6D5AFE96-9389-4CFB-893A-64D51D4542XX error=The operation couldn’t be completed. (com.apple.pushtotalk.channel error 1.), joined=true, activeChannelUUID is=6D5AFE96-9389-4CFB-893A-64D51D4542XX. So we are getting channelNotFound for 6D5AFE96-9389-4CFB-893A-64D51D4542XX but when at the same type checking active channel with channelManager.activeChannelUUID we are getting 6D5AFE96-9389-4CFB-893A-64D51D4542XX. After this we logout our user in our app. If we now try to login again we will get a scenario where "requestJoinChannel(channelUUID: UUID, descriptor: PTChannelDescriptor)" will result in just NO RESPONS in means of "channelManager(_ channelManager: PTChannelManager, didJoinChannel channelUUID: UUID, reason: PTChannelJoinReason)" or "channelManager(_ channelManager: PTChannelManager, failedToJoinChannel channelUUID: UUID, error: Error)" FYI: The fault are occuring on 17.3 also and the syslog I provided here is on 17.3 developer beta One interesting observation we have seen is that we only see this problem when "allow location access" is set to never for our app.
5
1
418
1w
PTChannelManager Discrepancies in Documentation
Hello, I am reading up on the documentation and seems to have some discrepancies but wanted to double check. In Overview for PTChannelManager, it states "Multiple calls to channelManager(delegate:restorationDelegate:completionHandler:) result in the system returning the same shared instance, so store the channel manager in an instance variable." https://developer.apple.com/documentation/pushtotalk/ptchannelmanager However if we look at the documentation for creation of a channel manager, in the completionHandler, it states that it will return "A new channel manager instance." https://developer.apple.com/documentation/pushtotalk/ptchannelmanager/4031737-channelmanager So is it a shared instance that gets returned or will a new instance be created? Need to know if we will need to implement a multiDelegate Pattern or not for this scenario for example if someone else called this function, would they take over the callbacks or would they get their own instance? Thank you.
1
0
547
Mar ’24
Push To Talk System UI doesn't activate audio session
So I have been able to get my app to record and receive PTT on the foreground successfully but when pressed the talk button in the system UI or when my app is in the background, the audio session is never activated hence func channelManager(_ channelManager: PTChannelManager, didDeactivate audioSession: AVAudioSession) never get called. My question is, is there any step or requirement that might prevent the system UI from activating the audio session even though the same code works perfectly fine whenever the app is in the foreground. I appreciate your help in advance.
1
0
578
Sep ’23
Push To Talk expected behavior when app terminated
I'm implementing Push To Talk functionality on my app. Now I have some trouble after app process is terminated by user. In my implementation, I download voice file in func channelManager(_ channelManager: PTChannelManager, didActivate audioSession: AVAudioSession) method. It works fine when app is foreground, and also ok when app is background until app process terminated. After app process terminated, system displays PTT connection status by blue icon in status bar. Then I got some PTT message from another person, func incomingPushResult(channelManager: PTChannelManager, channelUUID: UUID, pushPayload: [String : Any]) and func channelManager(_ channelManager: PTChannelManager, didActivate audioSession: AVAudioSession) are called, but download process is not finished and I cannot get voice file. What is the expected way to download voice file in such case?
1
0
520
Aug ’23
PTChannelDescriptor is not changing when I leave and then join another channel
I am using the same ChannelManager, however when switching to another channel, I leave the channel and then requestToJoin a new channel with the new inputted ChannelName and PTDescriptor however the name and image are not changing when I go to background to see the Native UI. Am I missing something to call for an update for the PTDescriptor?
1
0
713
Jul ’23
func channelManager(_ channelManager: PTChannelManager, didActivate audioSession: AVAudioSession) not called in background
I tried to press system Talk button to talk in channel when my APP in background, I see the channelManager(_ : PTChannelManager, _: UUID, didBeginTransmittingFrom _: PTChannelTransmitRequestSource) is called, but the function func channelManager(_ : PTChannelManager, didActivate _: AVAudioSession) never called. When my APP in foreground, everything works fine. I've set the APP's capability Background Modes -> Push to Talk. Anyone can help?
3
0
866
Aug ’23
PushToTalk - On App termination
How to programmatically leave a channel when an app is forced closed? Currently when a user closes the app, the channel remains active and can still talk via the status bar. However i imagine if a user force closes the app, they no longer want to talk. I tried implementing this via  func applicationWillTerminate(_ application: UIApplication) { // leave channel code } but it doesn't seem to work
3
0
1.2k
Dec ’23
Push to talk Framework and Audio Session
I am receiving a push through "incomingPushResultForChannelManager" of Push to talk Framework and setting a remote participant through "pushResultForActiveRemoteParticipant" or setting a remote participant using "setActiveRemoteParticipant" directly in the PTT App without receiving a push. When the app establishes a remote participant on a channel, an Audio Session is started anew and will receive an active Audio Session. The problem is that the time to activate this Audio Session is not short. For this reason, there are many cases where the first part of the other party's voice passes without being played. Also, if the app is running in the foreground, even if it doesn't acquire a new audio session, it can play the voice through the app's own audio session. However, by restarting the Audio Session, the Audio Session is changed unnecessarily and the voice playback is delayed. Question. Can I set the Audio Session to not change when setting the remote participant's information? If this is not possible, please advise on a solution for the case where the audio session is activated after the voice starts to be received.
2
0
1.4k
Oct ’23
Source code for Push To Talk demo app?
I was just watching the Enhance voice communication with Push To Talk WWDC22 session video and was wondering (a few questions) -- (1) (when) will you be making the demo app available that was shown at the beginning of the video? (2) There was some detail given regarding the new APNs push type ("pushtotalk"), but it was unclear to me if that's something I need to handle manually, or if those will be sent automatically when I do channelManager.requestBeginTransmitting? (3) How does the audio data itself get routed around? Is that handled by the system between the requestBeginTransmitting and stopTransmitting calls? Or somehow part of the APNs payload? Or something we must handle? Thank you! thanks!!
6
1
2.8k
Oct ’23