One Logo Pool Ball
wwwwwwwwwwwwwwwwwww

Native Platform APIs

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.

Shared services

APIWhat you can do
One.NotificationsRequest permission, schedule and dismiss notifications, handle responses, obtain push tokens, and configure Android channels
One.ClipboardRead, write, and check clipboard text
One.Network, useNetworkStateRead and subscribe to connection state
One.BrowserOpen a system browser or authentication session and dismiss it
One.Auth.AppleStart Apple authorization on iOS
One.HapticsProduce selection, impact, and notification feedback
One.AppInfoRead the installed version, build, and application identifier
One.ImagePickerPick library media or use the system camera picker
One.DocumentPickerSelect documents with cancellation and file metadata
One.SecureStoreStore strings in Keychain or encrypted Android storage, asynchronously or synchronously
One.DatabaseOpen and query SQLite databases through OP SQLite
One.LaunchScreenHold the launch screen until the app is ready, then hide it
One.UpdatesCheck, download, stage, and reload OTA bundles; the launcher handles early-failure rollback and cache pruning
One.openURL, One.openShare, One.openSettingsHand a URL, share payload, or settings request to the system
One.SpeechRequest permission and start or stop speech recognition
global cryptoGenerate secure random values and UUIDs
global fetchStream 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.

More native services

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.

APIWhat you can do
One.LocalAuthenticationCheck biometric support and request system authentication
One.ProtectedStoreProtect Keychain items with biometric or device-passcode access policies
One.StorageFast synchronous key-value storage
One.LocationRequest permission, locate, watch position, and geocode; background updates need configuration
One.MapServicesSearch places, request suggestions, reverse-geocode, and obtain directions
One.FileSystemRead and write sandbox files, inspect directories, and manage files
One.AudioPlay and record audio, configure background playback, and handle interruptions and Now Playing
One.iOS.CameraViewRender a camera preview and receive scanned codes
One.SharePresent the iOS share sheet and receive its result
One.PhotoLibrarySave, query, export, and manage Photos assets and albums
One.ImageManipulatorCrop, resize, rotate, and encode local images
One.ContactsRequest access, search, create, update, delete, and use the system contact picker
One.CalendarManage events and reminders, including supported recurrence rules
One.DeviceRead device and localization snapshots
One.MotionSubscribe to available motion sensors
One.ScreenOrientationRead, lock, unlock, and observe the active scene orientation
One.ScreenCaptureObserve capture state and screenshot events; capture a window or mounted view as PNG
One.PurchasesRead StoreKit products, purchase, restore, and observe transactions
One.BackgroundTasksRegister and schedule system-managed background work
One.DeviceAttestationUse App Attest and DeviceCheck with app-owned server validation
One.AppTrackingRead and request tracking permission
One.AppIconRead and change configured alternate icons
One.KeepAwakeControl the app’s idle-timer flag
One.PrintPresent the system print sheet for a local PDF
One.StoreReviewRequest a system review prompt; iOS decides whether to display it
One.QuickActionsManage Home Screen actions and receive warm or cold selections
One.Widgets, One.LiveActivities, One.iOS.WidgetUIUpdate 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.

Permissions and subscriptions

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().

HTTP

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.