Skip to content

Expo ​

O Pipa no Ar funciona com Expo em projetos com prebuild (development build ou build de release gerada por você ou pelo EAS). O Expo Go não carrega bundles de fora, então não serve para testar updates.

O que muda em relação ao guia rápido ​

Siga o guia rápido com estas diferenças. O npx @pipanoar/init detecta o Expo e já aplica as três.

Pacotes ​

sh
npx expo install @hot-updater/react-native@1.0.0-rc.24
npm install -D hot-updater@1.0.0-rc.24 @hot-updater/expo@1.0.0-rc.24 @pipanoar/hot-updater

Plugin no app.json ​

Adicione o plugin e gere a parte nativa de novo:

json
{
  "expo": {
    "plugins": ["@hot-updater/expo"]
  }
}
sh
npx expo prebuild

hot-updater.config.ts ​

ts
import { expo } from "@hot-updater/expo";
import { pipanoar } from "@pipanoar/hot-updater";
import { defineConfig } from "hot-updater";

export default defineConfig({
  build: expo(),
  ...pipanoar({ appId: "app_xxxxxxxxxxxxxxxxxxxx" }),
  updateStrategy: "appVersion",
});

O código do app (HotUpdater.wrap com pipanoarClient) é o mesmo do guia rápido.

Assinatura no Expo ​

Com assinatura de bundles, baixe a chave pública na página Assinatura do app e aponte a opção publicKeyPath do plugin @hot-updater/expo para o arquivo. Depois gere a build nativa de novo.