iOS
June 6, 2026 · View on GitHub
- The iOS client is built on native
URLSession. It handles requests,prefetch()(with an in‑memory cache for fresh results), streaming ({ stream: true }), and auto‑prefetch on app start. - Auto‑prefetch on app start fires automatically after launch via the linked pod — no manual call is required (see below).
nitroFetchOnWorkletruns the mapper on a worklet runtime (requiresreact-native-worklets), falling back to the JS thread when it isn't installed.
See also: docs/cronet-ios.md for notes on the iOS networking stack.
Auto‑Prefetch on App Start
- Schedule from JS at runtime (same as Android):
import { prefetchOnAppStart } from 'react-native-nitro-fetch';
await prefetchOnAppStart('https://httpbin.org/uuid', { prefetchKey: 'uuid' });
- (Optional) The prefetch already fires automatically on launch. You can also trigger it explicitly from
AppDelegate.swift— the call is a no-op if it has already run:
import NitroFetch
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
NitroAutoPrefetcher.prefetchOnStart()
return true
}
}
Notes
- Prefetch is best‑effort.
- Responses served shortly after prefetch include header
nitroPrefetched: true.