Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Windows Tipps & SecurityDave Plummer Has Made the Task Manager of Your Dreams(21.09.2026 um 21:20 Uhr)
Sichere ProgrammierungSubqueries and CTEs: Asking a Question Inside a Question(21.09.2026 um 21:00 Uhr)
Sichere ProgrammierungTVL Trend Analysis & Liquidity Risk Assessment: Lido(21.09.2026 um 21:00 Uhr)
Sichere ProgrammierungReact is Officially Dead in 2026 (Thanks to AI)(21.09.2026 um 21:01 Uhr)
Sichere ProgrammierungUsing SHA256 to Build Trustworthy Data Portals in Brazil(21.09.2026 um 21:01 Uhr)
Sichere Programmierung🚀 I reached 1,001 views on DEV!(21.09.2026 um 21:03 Uhr)
Sichere ProgrammierungReact Mental Models 2(21.09.2026 um 21:05 Uhr)
Sichere ProgrammierungAustralian RAM and SSD prices climb as stock tightens(21.09.2026 um 21:09 Uhr)
Windows Tipps & SecurityDave Plummer Has Made the Task Manager of Your Dreams(21.09.2026 um 21:20 Uhr)
Sichere ProgrammierungSubqueries and CTEs: Asking a Question Inside a Question(21.09.2026 um 21:00 Uhr)
Sichere ProgrammierungTVL Trend Analysis & Liquidity Risk Assessment: Lido(21.09.2026 um 21:00 Uhr)
Sichere ProgrammierungReact is Officially Dead in 2026 (Thanks to AI)(21.09.2026 um 21:01 Uhr)
Sichere ProgrammierungUsing SHA256 to Build Trustworthy Data Portals in Brazil(21.09.2026 um 21:01 Uhr)
Sichere Programmierung🚀 I reached 1,001 views on DEV!(21.09.2026 um 21:03 Uhr)
Sichere ProgrammierungReact Mental Models 2(21.09.2026 um 21:05 Uhr)
Sichere ProgrammierungAustralian RAM and SSD prices climb as stock tightens(21.09.2026 um 21:09 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

I built a native React Native downloader because AI models are huge

I ran into this while building Orb, a private offline AI app for Android. Orb runs local models on the phone. That is great for privacy, but it creates a very practical mobile problem: the app has to download model files that can be…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

I ran into this while building Orb, a private offline AI app for Android.



Orb runs local models on the phone. That is great for privacy, but it creates a very practical mobile problem: the app has to download model files that can be multiple gigabytes. If the network drops, the app backgrounds, or the user force-closes the app, restarting from zero is a terrible experience.



So I pulled the downloader out into a small open-source package:



GitHub: https://github.com/zraisan/react-native-client


NPM: https://www.npmjs.com/package/react-native-client



react-native-client is a native HTTP client for React Native apps that need direct-to-file downloads without moving bytes through the JavaScript bridge. The first stable API is focused on downloads, not general HTTP requests.





What it does



The package exposes a typed downloadFile API through Nitro Modules.



Under the hood:




  • Android uses OkHttp

  • iOS uses URLSession

  • files are streamed directly to disk on the native side

  • progress callbacks report bytes written and total length

  • resumable downloads use HTTP Range requests

  • partial-file resume validates Content-Range before appending

  • Android background mode uses a foreground service

  • iOS uses a background URLSession path



The main use case is large files: AI models, media packs, offline datasets, cache warmups, and anything else where a failed 2GB download should not mean starting over.





Basic usage





import { downloadFile, documentDirectoryPath } from 'react-native-client'

const result = await downloadFile({
fromUrl: 'https://example.com/model.gguf',
toFile: `${documentDirectoryPath}/model.gguf`,
})

console.log(result.statusCode, result.bytesWritten)





With progress:




await downloadFile({
fromUrl: 'https://example.com/large-file.bin',
toFile: `${documentDirectoryPath}/large-file.bin`,
begin: (statusCode, contentLength) => {
console.log('started', statusCode, contentLength)
},
onProgress: (bytesWritten, contentLength) => {
if (contentLength > 0) {
console.log(`${Math.round((bytesWritten / contentLength) * 100)}%`)
}
},
})






Resumable background download:




await downloadFile({
fromUrl: 'https://example.com/model.gguf',
toFile: `${documentDirectoryPath}/model.gguf`,
resumable: true,
background: true,
connectionTimeout: 30000,
readTimeout: 30000,
onProgress: (bytesWritten, contentLength) => {
console.log(bytesWritten, contentLength)
},
})






To resume after app relaunch, call the same request again with the same toFile and resumable: true. If the partial file is still there, the native client requests only the missing range.




const modelPath = `${documentDirectoryPath}/model.gguf`

await downloadFile({
fromUrl: modelUrl,
toFile: modelPath,
resumable: true,
background: true,
})









Why not just fetch?



For small files, normal app-level download logic is fine.



For Orb, the files are not small. A local AI model download needs to survive boring real-world mobile behavior: bad Wi-Fi, app backgrounding, retries, foreground service expectations on Android, and users reopening the app later.



I wanted the heavy transfer to stay native:




  • no file bytes crossing the JS bridge

  • native networking behavior on each platform

  • progress events for the UI

  • partial-file recovery when the server supports Range

  • safe restart when resume metadata is wrong or unsupported



The package is not trying to be a full download manager yet. It does not currently expose task IDs, cancellation, a persistent queue, checksums, uploads, or a general request/response client. The current goal is narrower: make large direct-to-file downloads reliable enough to build real product flows around them.






Install






npm install react-native-client react-native-nitro-modules









yarn add react-native-client react-native-nitro-modules









bun add react-native-client react-native-nitro-modules






For iOS:




cd ios
pod install






Android should work through normal React Native autolinking.






Current status



The package is early, but usable for the download flow it was built for.



Current version: 0.0.3



Requirements:




  • React Native app

  • react-native-nitro-modules >=0.35.0 <0.36.0

  • Android and/or iOS native builds



The README has a demo showing Android resume behavior: start a native background download, send the app home, return to the transfer, force-stop the app, relaunch, and resume from the partial file.






Why I’m releasing it



Orb needed this because private offline AI has a surprisingly unglamorous bottleneck: getting the model onto the device cleanly. The AI part gets the attention, but the first user experience is often just a large download that must not fail in a stupid way.



If you are building a React Native app that downloads big files, I’d love feedback on the API before it grows too much.



The next useful pieces are probably:




  • task IDs and cancellation

  • persistent background task registry

  • request headers and response metadata

  • checksum verification

  • upload support

  • broader HTTP APIs beyond file download



GitHub: https://github.com/zraisan/react-native-client


NPM: https://www.npmjs.com/package/react-native-client


Orb on Google Play: https://play.google.com/store/apps/details?id=com.falaq.orb

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten I built a native React Native downloader because AI models are huge

Thematisch verwandte Begriffe: built, native, React, Native · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-77582 | Tinyauth is an authentication and authorization server. Prior to 5.1.0, …
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick