iOS screen-sharing app that sends an iPhone screen and available app audio to a Google Cast TV over local Wi-Fi.
Built with React Native, React, TypeScript, Swift, ReplayKit, and the Google Cast SDK.
Use transformable.app to start your own self hosted cloud.
The app includes:
- TV connection – Select a TV with Google's native Cast button and Default Media Receiver.
- Screen sharing – Approve a broadcast through the iOS system sheet, then switch between apps.
- App audio – Share available app audio, with silence during gaps. Microphone audio stays off.
- Video – Share a fixed landscape canvas with orientation handling, aspect-fit video, and black borders.
- Low memory mode – Reduce video resolution and bitrate, with a saved setting for future broadcasts.
- Sharing controls – View connection status, start or stop sharing, and read inline instructions and error messages.
- Playback recovery – Retry TV playback or catch up to the receiver's live position.
The local toolchain requires Node.js 22.11 or later and pnpm 10. Native iOS builds require macOS, Xcode, and CocoaPods.
Screen sharing requires a physical iPhone with iOS 17 or later, a Google Cast TV, and a shared Wi-Fi network. The network must permit traffic between the iPhone and TV. Apple signing requires provisioning for the app, broadcast extension, and shared App Group.
To install and run the app:
-
Clone the repository.
-
Open the project directory:
cd transformable-relay -
Install the JavaScript dependencies:
pnpm install --frozen-lockfile
-
Install the native dependencies:
pnpm pods
-
Open
ios/Relay.xcworkspacein Xcode. -
Select the Relay target.
-
Choose your signing team and a unique bundle identifier.
-
Select the RelayBroadcast target.
-
Choose the same signing team.
-
Set the extension identifier to the app identifier plus
.Broadcast. -
Add the same registered App Group to both targets under Signing & Capabilities.
-
Set
RELAY_APP_GROUPto that group in both targets' build settings. -
Select your physical iPhone as the run destination.
-
Start Metro in a separate terminal:
pnpm start
-
Build and run the Relay scheme in Xcode.
The default app identifier is com.transformable.relay. The default App Group is group.com.transformable.relay.
If your signing team cannot provision these identifiers, replace them in both targets.
The app derives the extension identifier from its own bundle identifier.
This repository contains an iOS app and a ReplayKit broadcast extension. Expo Go cannot load the native extension.
The connection card shows the selected TV and the Cast button. The status badge shows NOT CONNECTED, CONNECTED, or ON AIR.
The main control starts a broadcast through the iOS approval sheet. Inline instructions describe approval, stream preparation, and TV playback. After playback starts, other apps can share their screen and available audio through the same broadcast.
Retry TV playback appears when the stream is ready but playback is not live. Catch up to live seeks to the receiver's live position without loading the stream again. Stop screen sharing ends the broadcast through the shared App Group.
To share the screen:
- Connect the TV and iPhone to the same Wi-Fi network.
- Enable Do Not Disturb to hide notifications from the shared screen.
- Open Relay.
- Tap the Cast button beside No TV connected.
- When iOS requests local network access, allow it.
- Select your TV.
- Tap Start screen sharing.
- Select Start Broadcast in the iOS sheet.
- Keep Relay open until its status shows ON AIR and the TV starts playback.
- Open other apps to share their screen and available audio.
- When you finish, return to Relay.
- Tap Stop screen sharing.
Everything visible on the screen enters the broadcast, including visible notifications. Protected content can appear blank or produce no app audio. Relay does not bypass capture restrictions.
The iOS recording indicator and Control Center also provide broadcast stop controls. The extension checks the app's stop command every second.
If you cancel the iOS sheet, tap Start screen sharing to try again. Each attempt prepares a fresh session. iOS requires approval for each broadcast.
After a broadcast interruption or Wi-Fi change, stop the broadcast and start a new one. An active stream does not migrate between Wi-Fi networks.
Low memory mode reduces the video resolution and target bitrate. The app saves this setting for future broadcasts.
| Setting | Standard | Low memory mode |
|---|---|---|
| Resolution | 1920 × 1080 | 1280 × 720 |
| Target video bitrate | 6 Mbps | 2.5 Mbps |
| Maximum frame rate | 30 fps | 30 fps |
| App audio | AAC stereo, 44.1 kHz | AAC stereo, 44.1 kHz |
To change the setting:
- Stop screen sharing.
- Turn on Low memory mode in Relay.
- Start a new broadcast.
The smaller canvas uses about 56% fewer output pixels. The stream buffer limit stays at 6 MiB in both modes. Actual extension memory use and playback stability require hardware tests.
The iPhone and TV communicate directly over Wi-Fi. The broadcast extension serves HLS media while the app runs in the background. The TV uses Google's Default Media Receiver. No separate TV app is included.
The TV fetches an unencrypted HTTP stream on port 8787. Each session uses a random token in its stream URL.
Use Relay on a trusted Wi-Fi network.
Video uses H.264 and fragmented MP4 segments with a target duration of 0.25 seconds. The encoder repeats the last frame on quiet screens and supplies silence during app audio gaps. Actual delay includes capture, encoding, network transfer, receiver buffering, and display. Segment duration does not establish the full screen-to-TV delay.
Available commands:
| Command | Purpose |
|---|---|
pnpm start |
Start Metro for development builds. |
pnpm ios |
Build and run the Relay scheme through the React Native CLI. |
pnpm pods |
Install native dependencies with CocoaPods. |
pnpm typecheck |
Run the TypeScript check. |
pnpm test |
Run JavaScript session tests. |
pnpm test:native |
Run native Swift tests. |
pnpm bundle:ios |
Build a standalone JavaScript bundle in /private/tmp/relay-main.jsbundle. |
| Path | Purpose |
|---|---|
src/App.tsx |
Connection controls, capture approval, status, and inline guidance. |
src/session.ts |
UI state calculations. |
src/native.ts |
JavaScript bindings for the native Relay module and buttons. |
ios/Relay/ |
Native app, React Native bridge, and Cast session control. |
ios/RelayBroadcast/ |
ReplayKit lifecycle, H.264/AAC encoding, and Wi-Fi HTTP server. |
ios/Shared/ |
Playlist, HTTP, and App Group data contracts. |
tests/ |
JavaScript session tests. |
native-tests/ |
Swift encoder, playlist, and HTTP server tests. |
docs/hardware-test.md |
Physical device playback procedure and acceptance conditions. |
The project pins React Native and React versions in package.json. The Podfile pins the Google Cast SDK.
The app and broadcast extension target iOS 17 or later. Both targets require the same signing team and shared App Group.
Native module changes require a new native build.
For a standalone device build, select the Release build configuration in Xcode. Then run the Relay scheme on your iPhone. The React Native build phase bundles JavaScript into the app. Release builds run without Metro.
To compile both targets for the simulator without signing:
xcodebuild -workspace ios/Relay.xcworkspace \
-scheme Relay -configuration Debug -sdk iphonesimulator \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath /tmp/relay-derived CODE_SIGNING_ALLOWED=NO buildThe simulator build does not establish screen-sharing behavior on physical devices.
Run these checks before you hand off application changes:
pnpm typecheck
pnpm test
pnpm test:native
git diff --checkNative tests require macOS, AVFoundation, and permission to bind a local socket. They encode synthetic video and audio, decode output, and exercise playlists, HTTP byte ranges, CORS, and segment eviction. They also cover audio format changes, invalid audio buffers, and capture gaps on quiet screens.
Automated tests do not establish TV compatibility, app audio availability, extension memory use, or screen-to-TV delay.