RORK LABJP
BUILD — Rork Max runs real Macs in the cloud loaded with Xcode and the iOS SDK, writing SwiftUI, compiling, reading the errors and building again. That loop, not the code generation, is what lifts the outputNATIVE — What comes out is pure Swift and SwiftUI, not React Native. Reaching AR, Metal graphics and widgets that React Native cannot touch is the real gap between this and other buildersPLATFORMS — Coverage spans iPhone, iPad, Apple Watch, Apple TV and Vision Pro, plus iMessage. Worth a look if you want to start from a watch app or an extension rather than a phone screenCOMPANION — The Rork Companion app lets you check a generated build on a real iPhone without a paid Apple Developer account, lowering the bar for trying a first project end to endPRICING — Free to start, paid plans from $25 a month, and Rork Max on the $200 Max plan. Worth working out up front how many projects it takes to earn that backDEADLINE — From August 31, 2026, Google Play requires target API level 36 or higher for new apps and updates alike. Ten days out, and the targetSdkVersion of what you generate is yours to verifyBUILD — Rork Max runs real Macs in the cloud loaded with Xcode and the iOS SDK, writing SwiftUI, compiling, reading the errors and building again. That loop, not the code generation, is what lifts the outputNATIVE — What comes out is pure Swift and SwiftUI, not React Native. Reaching AR, Metal graphics and widgets that React Native cannot touch is the real gap between this and other buildersPLATFORMS — Coverage spans iPhone, iPad, Apple Watch, Apple TV and Vision Pro, plus iMessage. Worth a look if you want to start from a watch app or an extension rather than a phone screenCOMPANION — The Rork Companion app lets you check a generated build on a real iPhone without a paid Apple Developer account, lowering the bar for trying a first project end to endPRICING — Free to start, paid plans from $25 a month, and Rork Max on the $200 Max plan. Worth working out up front how many projects it takes to earn that backDEADLINE — From August 31, 2026, Google Play requires target API level 36 or higher for new apps and updates alike. Ten days out, and the targetSdkVersion of what you generate is yours to verify
Articles/App Dev
App Dev/2026-06-29Advanced

Respecting Metered Connections and Low Data Mode in an Image-Heavy Rork App

In an image-heavy Rork (Expo) app, hold back prefetching on metered connections and Low Data Mode. Read the connection's character from NetInfo details, drop image quality, and defer prefetch with an adaptive policy layer, all with working code.

Rork539Expo175NetInfoLow Data ModePrefetchNetwork Optimization

Premium Article

A review of one of the wallpaper apps I run once said, "I opened it where there was no Wi-Fi and my data melted in seconds." The cause was immediate: the list screen was aggressively prefetching the next page of high-resolution images. Behavior that adds comfort on Wi-Fi was quietly eating the user's mobile data on a metered connection. The more images an app handles, the more this "well-intentioned prefetch" backfires.

This walkthrough, using a Rork-generated Expo app, lays out a network design that reads the connection's character and adapts prefetch and image quality. The key is to stop seeing the connection as a binary "connected or not," and go further: is it metered, is it slow, is it a saver mode?

Stop judging on "online or not" alone

Many apps look only at isConnected and, if connected, do everything. But users' connections are not uniform. NetInfo's details carries far more you can act on.

SignalSource (NetInfo)What it means
Metered?details.isConnectionExpensiveOS considers it a "costly" connection (includes tethering)
Connection typetype (wifi / cellular / ...)Wi-Fi or mobile
Cellular generationdetails.cellularGeneration (3g/4g/5g)A speed proxy (avoid heavy prefetch on 3g)
Saver modesee belowThe user is explicitly conserving data

isConnectionExpensive is the OS's "metered-equivalent" flag, and it includes Wi-Fi over tethering. Honoring just this prevents most "data melts away" incidents like the one in that review.

Low Data Mode needs a caveat. There is no clean, unified API for an app to read iOS Low Data Mode or Android Data Saver as a simple on/off. In practice, treat isConnectionExpensive as a proxy for saver intent, and pair it with a second layer: an in-app conservation switch the user controls. Merge both the OS's intent (metered judgment) and the app's setting (explicit switch) into the policy.

Centralize the network judgment

Scatter the connection judgment across screens and the decisions will inevitably diverge. Build one layer that converts connection info into a single policy, and have every screen look only at that policy.

// net/networkPolicy.ts
import NetInfo, { NetInfoState } from "@react-native-community/netinfo";
 
export type PrefetchLevel = "full" | "lite" | "off";
export type ImageQuality = "high" | "medium" | "low";
 
export interface NetworkPolicy {
  prefetch: PrefetchLevel;   // strength of look-ahead
  imageQuality: ImageQuality; // quality to fetch
  allowAutoplay: boolean;     // whether video/GIF autoplay is allowed
}
 
// Convert connection state + the app's saver setting into one policy
export function derivePolicy(
  state: NetInfoState,
  saverEnabled: boolean
): NetworkPolicy {
  // Not connected
  if (!state.isConnected) {
    return { prefetch: "off", imageQuality: "low", allowAutoplay: false };
  }
 
  const expensive = !!(state.details as any)?.isConnectionExpensive;
  const gen = (state.details as any)?.cellularGeneration as string | undefined;
  const isSlowCellular = state.type === "cellular" && (gen === "2g" || gen === "3g");
 
  // User chose to conserve, OR OS says metered, OR it is slow
  if (saverEnabled || expensive || isSlowCellular) {
    return { prefetch: "off", imageQuality: "medium", allowAutoplay: false };
  }
 
  // Ordinary mobile (4g/5g, non-metered)
  if (state.type === "cellular") {
    return { prefetch: "lite", imageQuality: "high", allowAutoplay: false };
  }
 
  // Wi-Fi (non-metered) — prefetch at full strength
  return { prefetch: "full", imageQuality: "high", allowAutoplay: true };
}

Hand this policy out through a React context and every screen makes a consistent decision just by reading useNetworkPolicy().

// net/NetworkPolicyProvider.tsx
import React, { createContext, useContext, useEffect, useState } from "react";
import NetInfo from "@react-native-community/netinfo";
import { derivePolicy, NetworkPolicy } from "./networkPolicy";
import { useDataSaver } from "../settings/useDataSaver"; // in-app conservation switch
 
const Ctx = createContext<NetworkPolicy>({
  prefetch: "lite", imageQuality: "high", allowAutoplay: false,
});
 
export function NetworkPolicyProvider({ children }: { children: React.ReactNode }) {
  const saver = useDataSaver();
  const [policy, setPolicy] = useState<NetworkPolicy>(Ctx._currentValue);
 
  useEffect(() => {
    // Fetch the current value once on subscribe, then listen for changes
    const unsub = NetInfo.addEventListener((state) => {
      setPolicy(derivePolicy(state, saver));
    });
    NetInfo.fetch().then((state) => setPolicy(derivePolicy(state, saver)));
    return () => unsub();
  }, [saver]);
 
  return <Ctx.Provider value={policy}>{children}</Ctx.Provider>;
}
 
export const useNetworkPolicy = () => useContext(Ctx);

The key is including the saver switch (saver) in the dependencies. The moment the user flips the switch in settings, the policy recomputes and prefetch behavior follows instantly.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Get an adaptive-prefetch implementation that automatically stops look-ahead and lowers image quality when the connection is metered, slow, or in a saver mode
Build a single centralized network-policy layer that reads isConnectionExpensive and cellular generation from NetInfo details and converts them into a policy
Move past the all-or-nothing 'prefetch everything or do nothing' choice toward behavior that scales with the connection
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

App Dev2026-08-18
The three places I had to fix before a Rork project actually targeted API level 36
My app.json said targetSdkVersion 36. The value my build actually read was 35. Here is the script that reports the effective value, and how I split my apps between raising, leaving alone, and requesting an extension.
App Dev2026-08-16
My chart broke on day one, not at scale
A line chart that vanished for anyone with only a few days of data. The cause was a zero-height Y axis turning coordinates into NaN. Here is the measured behavior and the small normalization layer that fixed it.
App Dev2026-08-06
Deciding overlay text legibility at ingest time instead of on device — four metrics measured side by side
Moving the question of whether text stays readable over a wallpaper out of the device and into the content pipeline. Four candidate metrics measured across 240 images, including what downscaled judging actually computes.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →