Find the shipped shared and iOS service APIs, permissions, and lifecycle contracts
Service namespaces live on One, including services with platform-specific
operations. The camera view and widget layout helpers below use One.iOS.
Hooks are named imports from one. Use each reference for the complete
signature, configuration, permission behavior, event cleanup, and errors.
| API | What you can do |
|---|---|
| One.Notifications | Request permission, schedule and dismiss notifications, handle responses, obtain push tokens, and configure Android channels |
| One.Clipboard | Read, write, and check clipboard text |
| One.Network, useNetworkState | Read and subscribe to connection state |
| One.Browser | Open a system browser or authentication session and dismiss it |
| One.Auth.Apple | Start Apple authorization on iOS |
| One.Haptics | Produce selection, impact, and notification feedback |
| One.AppInfo | Read the installed version, build, and application identifier |
| One.ImagePicker | Pick library media or use the system camera picker |
| One.DocumentPicker | Select documents with cancellation and file metadata |
| One.SecureStore | Store strings in Keychain or encrypted Android storage, asynchronously or synchronously |
| One.Database | Open and query SQLite databases through OP SQLite |
| One.LaunchScreen | Hold the launch screen until the app is ready, then hide it |
| One.Updates | Check, download, stage, and reload OTA bundles; the launcher handles early-failure rollback and cache pruning |
| One.openURL, One.openShare, One.openSettings | Hand a URL, share payload, or settings request to the system |
| One.Speech | Request permission and start or stop speech recognition |
| global crypto | Generate secure random values and UUIDs |
global fetch | Stream native HTTP responses and upload React Native file parts |
One.Auth.Apple is grouped under the shared authentication namespace, but Apple
authorization is an iOS operation. On Android and web, isAvailable is false and authorization calls reject.
Secure storage uses string keys and values:
import { One } from 'one'
export async function saveSession(token: string) { await One.SecureStore.setItem('session', token)}
export async function readSession() { return One.SecureStore.getItem('session')}
export async function clearSession() { await One.SecureStore.deleteItem('session')}A missing key reads null. SecureStore rejects on web; choose a separate web
session strategy. The synchronous verbs block the JavaScript thread, so reserve
them for a value needed synchronously, such as an initial session read.
These service namespaces are exported on One. Their references describe
supported platforms, native configuration and unavailable operations.
One.iOS.CameraView and One.iOS.WidgetUI are iOS components.
| API | What you can do |
|---|---|
| One.LocalAuthentication | Check biometric support and request system authentication |
| One.ProtectedStore | Protect Keychain items with biometric or device-passcode access policies |
| One.Storage | Fast synchronous key-value storage |
| One.Location | Request permission, locate, watch position, and geocode; background updates need configuration |
| One.MapServices | Search places, request suggestions, reverse-geocode, and obtain directions |
| One.FileSystem | Read and write sandbox files, inspect directories, and manage files |
| One.Audio | Play and record audio, configure background playback, and handle interruptions and Now Playing |
| One.iOS.CameraView | Render a camera preview and receive scanned codes |
| One.Share | Present the iOS share sheet and receive its result |
| One.PhotoLibrary | Save, query, export, and manage Photos assets and albums |
| One.ImageManipulator | Crop, resize, rotate, and encode local images |
| One.Contacts | Request access, search, create, update, delete, and use the system contact picker |
| One.Calendar | Manage events and reminders, including supported recurrence rules |
| One.Device | Read device and localization snapshots |
| One.Motion | Subscribe to available motion sensors |
| One.ScreenOrientation | Read, lock, unlock, and observe the active scene orientation |
| One.ScreenCapture | Observe capture state and screenshot events; capture a window or mounted view as PNG |
| One.Purchases | Read StoreKit products, purchase, restore, and observe transactions |
| One.BackgroundTasks | Register and schedule system-managed background work |
| One.DeviceAttestation | Use App Attest and DeviceCheck with app-owned server validation |
| One.AppTracking | Read and request tracking permission |
| One.AppIcon | Read and change configured alternate icons |
| One.KeepAwake | Control the app’s idle-timer flag |
| One.Print | Present the system print sheet for a local PDF |
| One.StoreReview | Request a system review prompt; iOS decides whether to display it |
| One.QuickActions | Manage Home Screen actions and receive warm or cold selections |
| One.Widgets, One.LiveActivities, One.iOS.WidgetUI | Update a generated WidgetKit extension and ActivityKit presentations |
Widget and Live Activity APIs need a generated extension, App Group, and the relevant signing capabilities. Native project setup shows the configuration. Widgets render a supported serialized JSX layout, not an arbitrary React Native subtree.
Configure native usage descriptions and capabilities before building the app, then request runtime permission from the corresponding API. A camera picker, camera preview, library picker, and Photos library management have different permission contracts. The system picker can select media without granting the app general library access.
A live network subscription returns an object with remove():
import { useEffect, useState } from 'react'import { One } from 'one'
export function useConnectionType() { const [type, setType] = useState('unknown')
useEffect(() => { const subscription = One.Network.addStateListener((state) => { setType(state.type) }) return () => subscription.remove() }, [])
return type}For a component that also needs the initial snapshot, use the exported
useNetworkState hook. Other services can return an unsubscribe function or
another handle; follow their own cleanup signature rather than assuming every
service uses remove().
Native global fetch streams response bodies and accepts React Native file
parts in FormData. Use its standard request and response objects by calling
the global fetch function directly. Streaming is separate from
One.Network, which reports connection state.
Edit this page on GitHub.