@devries-cameron20 / t3code-1 / commits / b65f8686b3
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(mobile): leaving the iOS app for a few seconds no longer drops the connection (#26540)

Co-authored-by: maria-rcks <maria@kuuro.net>

Sunghyun Cho committed Oct 31, 2026 at 04:34 UTC b65f8686b3c7e16573f99d41a9539ff365cf1e89
2 files changed +25 -1
apps/mobile/modules/t3-native-controls/expo-module.config.json
+2 -1
@@ -4,7 +4,8 @@
4 "modules": ["T3NativeControlsModule", "T3KeyboardCommandsModule"],
5 "appDelegateSubscribers": [
6 "T3WorkspaceOrientationSubscriber",
7 - "T3MenuDismissTouchGateSubscriber"
7 + "T3MenuDismissTouchGateSubscriber",
8 + "T3BackgroundGraceSubscriber"
9 ]
10 },
11 "android": {
apps/mobile/modules/t3-native-controls/ios/T3BackgroundGraceSubscriber.swift new
+23
@@ -0,0 +1,23 @@
1 +import ExpoModulesCore
2 +import UIKit
3 +
4 +public final class T3BackgroundGraceSubscriber: ExpoAppDelegateSubscriber {
5 + private var task = UIBackgroundTaskIdentifier.invalid
6 +
7 + public func applicationWillResignActive(_ application: UIApplication) {
8 + guard task == .invalid else { return }
9 + task = application.beginBackgroundTask(withName: "T3 connection grace") { [weak self] in
10 + self?.endTask(application)
11 + }
12 + }
13 +
14 + public func applicationDidBecomeActive(_ application: UIApplication) {
15 + endTask(application)
16 + }
17 +
18 + private func endTask(_ application: UIApplication) {
19 + guard task != .invalid else { return }
20 + application.endBackgroundTask(task)
21 + task = .invalid
22 + }
23 +}