Send files directly between devices over the internet - no cloud storage, no size limits.
TypeScript cross-platformdata-transferdecentralizedfile-sharingfile-transferhole-punchingopen-sourcep2ppeer-to-peerprivacyprivacy-tools
import { AppState, type AppStateStatus } from 'react-native'
import { setAppActive } from '@altersend/domain'
let started = false
let subscription: { remove: () => void } | null = null
export function startAppStateBridge(): () => void {
if (started) return () => {}
started = true
setAppActive(AppState.currentState === 'active')
subscription = AppState.addEventListener('change', (next: AppStateStatus) => {
setAppActive(next === 'active')
})
return () => {
started = false
subscription?.remove()
subscription = null
}
}