StreamGate is an open-source iOS reference app that captures video (native camera or device-wide ReplayKit screen recording) and uploads it directly to the cloud in resumable chunks using the FastPix iOS Uploads SDK, then returns an instant, shareable playback link. Use it as a working example of complex mobile media workflows.
Works with: iOS 16+ · SwiftUI · ReplayKit · AVFoundation · FastPix iOS Uploads SDK · physical iPhone
📖 Upload SDK docs: https://fastpix.com/docs/upload-videos/set-up-resumable-uploads-for-ios · ⬆️ Uploads SDK: https://github.com/FastPix/iOS-Uploads · 🚀 Dashboard: https://dashboard.fastpix.com
StreamGate is built with a modern iOS stack (100% Swift, SwiftUI, ReplayKit, AVFoundation) and shows how to:
- Camera capture - record video natively with
UIImagePickerController. - Screen recording - capture device-wide screen activity with Apple's
ReplayKitBroadcast Extension andAVAssetWriter, running reliably in a separate sandboxed process. - Direct cloud uploading - push large media files to the cloud in resumable chunks with the FastPix iOS Uploads SDK, with no intermediary backend server.
- Local playback / preview - preview the recording with
AVPlayerbefore the shareable link is generated. - Auto cleanup - delete previous recordings before each new session to keep on-device storage low.
Once an upload completes, StreamGate generates an instant, shareable playback link.
If you are setting up this demo for the first time, follow these steps in order:
- Check your macOS version
- Check that Xcode is installed
- Connect a physical iPhone
- Get your FastPix credentials
- Clone the repository
- Verify the FastPix iOS Uploads SDK
- Verify App Groups on both targets
- Verify the broadcast extension identifier
- Configure your FastPix credentials
- Build and run on your device
- Record, upload, and verify it works
Do not skip the verification commands. If a step's check fails, fix that problem before you continue.
Make sure you have the following ready. This app uses a ReplayKit Broadcast Extension and the device camera, so it needs a real iPhone.
| Requirement | Details |
|---|---|
| A Mac with Xcode 26 or later | Install the full Xcode app from the App Store. It provides the build tools, the Swift compiler, and Git. The committed project was created with Xcode 26.5. |
| A physical iPhone running iOS 26 | Both targets set an iOS 26 deployment target, and ReplayKit Broadcast Extensions do not work reliably on the Simulator, so you need a real device. |
| An Apple Developer account | Needed to code-sign the main app and the broadcast extension for your device. |
| A FastPix account | Free to create at the FastPix Dashboard. |
| FastPix API credentials | An Access Token ID (Token ID) and a Secret Key. |
The app reads your credentials from two environment variables at runtime:
| App environment variable | FastPix credential |
|---|---|
ACCESS_TOKEN_ID |
Access Token ID (Token ID) |
SECRET_KEY |
Secret Key |
Supported iOS versions: The app's code supports iOS 16.0+ (guarded with
if #available(iOS 16.0, *)), but the committed project targets iOS 26. To run on an older OS, lowerIPHONEOS_DEPLOYMENT_TARGETon both theStreamGateandScreenBroadcastExtensiontargets in Build Settings (see It will not build or install on iOS 16).
Security: Never commit your Access Token ID or Secret Key to source control. Set them in your Xcode scheme.
The build tools run on macOS. Confirm your version:
sw_versOutput is similar to:
ProductName: macOS
ProductVersion: 26.6.2
BuildVersion: 25G83
Use a macOS version that supports Xcode 26. If macOS is too old, update it before you continue.
This project builds with the full Xcode app. Confirm the command line points at Xcode:
xcodebuild -versionExpected output is similar to:
Xcode 26.6
Build version 17F113
If instead you see xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance, point the command line at Xcode (this needs your password):
sudo xcode-select --switch /Applications/Xcode.app
sudo xcodebuild -license acceptThen run xcodebuild -version again. Do not continue until it prints a version.
Screen recording relies on a ReplayKit Broadcast Extension, which does not work reliably on the Simulator, so run on a real iPhone. Connect and unlock your iPhone (tap Trust This Computer if prompted), then confirm the toolchain sees it:
xcrun xctrace list devicesYour iPhone appears under == Devices == alongside any simulators.
The app authenticates to FastPix to create a signed direct-upload URL, so you need your API credentials:
- Sign up or log in and follow the Activate Your Account guide.
- Copy your Access Token ID (Token ID) and Secret Key.
You set these as environment variables in Configure your FastPix credentials. Never commit real credentials to version control.
git clone https://github.com/FastPix/iOS-StreamGate.git
cd iOS-StreamGate
open StreamGate.xcodeprojThe clone creates a folder named
iOS-StreamGate(the repository name).StreamGate.xcodeprojand theStreamGate/source folder both live inside it, so run the commands from theiOS-StreamGateroot.
StreamGate uses the FastPix iOS Uploads SDK for resumable chunked uploads. The SDK is already integrated via Swift Package Manager, so you don't need to add it manually - Xcode resolves it when you open the project.
To confirm it resolves from the command line, run this from the iOS-StreamGate root:
xcodebuild -project StreamGate.xcodeproj -scheme StreamGate -resolvePackageDependenciesThe output confirms the package (the product is fp-swift-upload-sdk, module fp_swift_upload_sdk):
Resolved source packages:
fp-swift-upload-sdk: https://github.com/FastPix/iOS-Uploads.git @ 1.0.2
In Xcode, you can also confirm the main StreamGate target lists both the SDK and the embedded extension under Frameworks, Libraries, and Embedded Content:
Frameworks, Libraries, and Embedded Content
├── fp-swift-upload-sdk
└── ScreenBroadcastExtension.appex → Embed Without Signing
ScreenBroadcastExtension.appexmust be set to Embed Without Signing so iOS bundles the extension inside the main app at install time. Without this the broadcast picker shows no available extension.
For full SDK setup instructions, see Set up Resumable Uploads for iOS.
The StreamGate main app and the ScreenBroadcastExtension communicate through a shared App Group, which is already configured on both targets in the committed project. Confirm both use the same App Group under each target's Signing & Capabilities → App Groups:
group.com.streamgate.broadcast
The App Group identifier must match exactly on both targets. If they differ, the extension and main app read and write different sandboxed directories, and no recorded file is ever detected.
To learn more, see ReplayKit - Apple Developer Documentation.
Confirm the broadcast extension's Bundle Identifier:
com.streamgate.StreamGate.ScreenBroadcastExtension
The same identifier is referenced in BroadCastPickerView.swift:
picker.preferredExtension = "com.streamgate.StreamGate.ScreenBroadcastExtension"The app reads your FastPix credentials from environment variables at runtime via ProcessInfo (ACCESS_TOKEN_ID and SECRET_KEY). Set them in your Xcode scheme:
- Go to Product → Scheme → Edit Scheme (or press
⌘ <) - Select the Run action → Arguments tab
- Under Environment Variables, add:
| Name | Value |
|---|---|
ACCESS_TOKEN_ID |
Your FastPix Token ID |
SECRET_KEY |
Your FastPix Secret Key |
Never commit credentials to version control. Get your credentials from Activate Your Account.
The app already requests camera and microphone access (declared in its generated Info.plist), so no extra permission setup is needed. For reference, it presents NSCameraUsageDescription ("Used to record videos.") and NSMicrophoneUsageDescription ("Used to record audio.").
In Xcode:
- Open
StreamGate.xcodeproj. - Select your connected iPhone as the run destination.
- Under Signing & Capabilities, select your Apple Developer Team for both targets:
StreamGateScreenBroadcastExtension
- Confirm the App Group
group.com.streamgate.broadcastis enabled on both targets. - Build and run: Product → Clean Build Folder, then Product → Run (
⌘R).
The first build compiles the Uploads SDK, so it can take a little longer. If the app does not launch on the device, open Settings → General → VPN & Device Management on the iPhone and trust your developer certificate, then run again.
Record a video with the camera, or start a screen broadcast, then let the app upload it. On success:
- The app uploads the file to FastPix in resumable chunks and polls until the media reaches
status: ready. - A shareable playback link appears in the form
https://stream.fastpix.com/<playbackId>.m3u8.
If the upload does not start or no link appears, see Troubleshooting.
- Language: Swift
- UI Framework: SwiftUI
- Screen Capture: ReplayKit (
RPBroadcastSampleHandler,RPSystemBroadcastPickerView) - Video Encoding: AVFoundation (
AVAssetWriter, H.264) - Inter-process Communication: App Groups (shared
UserDefaults+ shared filesystem) - Uploading: FastPix iOS Uploads SDK
- Build Constraints:
iOS 16.0+, Xcode 15+, real device required
Set ScreenBroadcastExtension.appex to Embed Without Signing in the main app target (see Step 6). Without this, iOS does not bundle the extension and the picker is empty.
The App Group identifier must match exactly on both targets (group.com.streamgate.broadcast). If they differ, the extension and app use different sandboxed directories. See Step 7.
- Confirm the
ACCESS_TOKEN_IDandSECRET_KEYenvironment variables are set in your Run scheme (see Step 9). - Confirm the credentials are active in your FastPix Dashboard and not expired.
- Check network connectivity on the device.
The committed project targets iOS 26.0. Lower IPHONEOS_DEPLOYMENT_TARGET to 16.0 on both the StreamGate and ScreenBroadcastExtension targets (see Before you begin).
Use a physical iPhone - ReplayKit Broadcast Extensions are unreliable on the Simulator.
StreamGate shows uploads plus screen/camera capture in a full app. For the underlying SDKs and other platforms, use:
| I want to... | Repo |
|---|---|
| Add resumable uploads to an iOS app (the SDK this demo uses) | iOS-Uploads |
| Play FastPix video in an iOS app | iOS-player |
| Add playback QoE analytics for AVPlayer (iOS / tvOS) | iOS-data-avplayer-sdk |
| Add resumable uploads in the browser | web-uploads-sdk |
| Add a React uploader component | react-web-uploader |
Browse everything in the FastPix organization.
What does this app do? It records video (camera or full-screen ReplayKit recording) and uploads it directly to FastPix in resumable chunks, then returns a shareable playback link. See What this app demonstrates.
Why does it need a physical iPhone? ReplayKit Broadcast Extensions do not work reliably on the Simulator. See Before you begin.
Where do I get my Token ID and Secret Key? From the FastPix Dashboard, via the Activate Your Account guide. See Get your FastPix credentials.
Where do I put my credentials?
Set ACCESS_TOKEN_ID and SECRET_KEY as environment variables in your Xcode Run scheme. See Step 9.
The broadcast picker is empty - why? The broadcast extension is not embedded. Set it to Embed Without Signing. See Troubleshooting.
Which iOS versions does it support? The app's code supports iOS 16.0+, but the committed project currently targets iOS 26.0. See Before you begin for how to lower it.
How do I add resumable uploads to my own app? Use the FastPix iOS Uploads SDK directly. See Which FastPix repo do I need?
- FastPix Platform: fastpix.com
- FastPix Access Token Guide: Activate Your Account
- FastPix VOD Upload API Docs: Direct Upload Video Media
- FastPix iOS Uploads SDK: FastPix/iOS-Uploads
- Apple ReplayKit Docs: ReplayKit - Apple Developer
StreamGate is licensed under the MIT License - see the LICENSE file for details.