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!!

Post not yet marked as solved Up vote post of drewster Down vote post of drewster
2.5k views

Replies

I also need help implementing Push To Talk into my app, and having the demo app's source code would help a lot. Searched a lot today and haven't found anything. Can anyone help with the source code if they have it?

Just wanted to share what I discovered today with my testing. You will need to create a new APNs cert if you haven't done that lately and are using cert based push notifications. They have updated the text to read:

Apple Push Notification service SSL (Sandbox & Production) Establish connectivity between your notification server, the Apple Push Notification service sandbox, and production environments to deliver remote notifications to your app. When utilizing HTTP/2, the same certificate can be used to deliver app notifications, update ClockKit complication data, and alert background VoIP apps of incoming activity. A separate certificate is required for each app you distribute.

After I updated my cert, I was able to get the incoming push notification to properly deliver to:

func incomingPushResult(channelManager: PTChannelManager, channelUUID: UUID, pushPayload: [String : Any]) -> PTPushResult

I was using a simple script that calls curl like this:


curl -v \
-d '{"activeSpeaker":"Bart"}' \
-H "apns-push-type: pushtotalk" \
-H "apns-topic: <insert your bundle id here>.voip-ptt" \
-H "apns-priority: 10" \
-H "apns-expiration: 0" \
--http2 \
--cert key.pem \
https://api.sandbox.push.apple.com/3/device/8f12332d93d45d39d407368175e07b76d2494d0d67439289b3a50c7bd6f8f206

Also, I noticed that PTChannelTransmitRequestSource is always of type .unknown when the system UI is used to transmit.

I would love to have some sample code too. I'm still working on hooking up the portions of my app that would record/playback the audio.

  • Hello tethridge,

    From the documentation, we are suppose to publish push token to our provider server in order to receive APNS, what about channelUUID? Any article/document on this channel UUID. channelUUID what we receive part of incomingPushResult carries UUID of sender/receiver?

    I am not finding more information on channelUUID, Appreciate if you can share any additional information

    Thanks

  • I have created Apple Push Notification Certificate for our App. Also added the Capability for APNS as suggested. Still not able to get APNS CallBack to app. What can be the reason. I am using device having iOS 16 Beta. Please suggest.

Add a Comment

I would like to know when the demo source will be available?

Hi,

Unfortunately, at this time, the specific demo app source code in the WWDC session is not pending public release.

You can however copy from the "Code" tab in the Developer app. It has the basic implementation skeleton to get you started.

If you already have a PTT or VoIP calling app, you should be able to reuse the vast majority of what you already have.

See also https://developer.apple.com/forums/thread/707689

Hi, where is this "Code" tab you speak of? I don't see anything of the sorts on the page

  • Try opening this link with the Developer app (on macOS or iOS) installed: https://developer.apple.com/wwdc22/10117

  • Searching this link leads to No Search Result page. However, you can simply type ptt in the search field. Then you will be able to click on Code segment and see some code snippets

Add a Comment

Push To Talk is system ui framework with Audio Session handling and custom APNS feature. You need to develop backend ptt service like webrtc or better mediasoup.