Skip to content

Commit 4e72a03

Browse files
chore(expo-sample): Add Expo Updates (#4725)
1 parent ae8e50c commit 4e72a03

5 files changed

Lines changed: 224 additions & 97 deletions

File tree

samples/expo/app.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,25 @@
7171
}
7272
}
7373
]
74-
]
74+
],
75+
"extra": {
76+
"router": {
77+
"origin": false,
78+
"asyncRoutes": {
79+
"web": true,
80+
"default": "development"
81+
}
82+
},
83+
"eas": {
84+
"projectId": "00000000-0000-0000-0000-000000000000"
85+
}
86+
},
87+
"owner": "__OWNER__",
88+
"runtimeVersion": {
89+
"policy": "appVersion"
90+
},
91+
"updates": {
92+
"url": "https://u.expo.dev/00000000-0000-0000-0000-000000000000"
93+
}
7594
}
7695
}

samples/expo/app/(tabs)/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@ import { Text, View } from '@/components/Themed';
77
import { setScopeProperties } from '@/utils/setScopeProperties';
88
import React from 'react';
99
import * as WebBrowser from 'expo-web-browser';
10+
import { useUpdates } from 'expo-updates';
1011

1112
const isRunningInExpoGo = Constants.appOwnership === 'expo'
1213

1314
export default function TabOneScreen() {
15+
const { currentlyRunning } = useUpdates();
1416
return (
1517
<View style={styles.container}>
1618
<Sentry.TimeToInitialDisplay record />
1719
<Text>Welcome to Sentry Expo Sample App!</Text>
20+
<Text>Update ID: {currentlyRunning.updateId}</Text>
21+
<Text>Channel: {currentlyRunning.channel}</Text>
22+
<Text>Runtime Version: {currentlyRunning.runtimeVersion}</Text>
1823
<Button
1924
title="Capture message"
2025
onPress={() => {

samples/expo/eas.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"cli": {
3+
"version": ">= 16.1.0",
4+
"appVersionSource": "remote"
5+
},
6+
"build": {
7+
"development": {
8+
"developmentClient": true,
9+
"distribution": "internal",
10+
"channel": "development"
11+
},
12+
"preview": {
13+
"distribution": "internal",
14+
"channel": "preview"
15+
},
16+
"production": {
17+
"autoIncrement": true,
18+
"channel": "production"
19+
}
20+
},
21+
"submit": {
22+
"production": {}
23+
}
24+
}

samples/expo/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,23 @@
1313
"export": "expo export --dump-sourcemap --clear --platform all",
1414
"export:web": "expo export --dump-sourcemap --clear --platform web",
1515
"prebuild": "expo prebuild --clean --no-install",
16-
"set-version": "npx react-native-version --skip-tag --never-amend"
16+
"set-version": "npx react-native-version --skip-tag --never-amend",
17+
"eas-build-pre-install": "corepack enable && yarn install --no-immutable --inline-builds && yarn workspace @sentry/react-native build"
1718
},
1819
"dependencies": {
1920
"@sentry/react-native": "6.11.0-beta.0",
2021
"@types/react": "~18.3.12",
21-
"expo": "~52.0.41",
22+
"expo": "~52.0.42",
2223
"expo-constants": "~17.0.8",
2324
"expo-image-picker": "~16.0.5",
2425
"expo-linking": "~7.0.5",
2526
"expo-router": "~4.0.19",
2627
"expo-status-bar": "~2.0.1",
28+
"expo-updates": "~0.27.4",
2729
"expo-web-browser": "^14.0.2",
2830
"react": "18.3.1",
2931
"react-dom": "18.3.1",
30-
"react-native": "0.76.7",
32+
"react-native": "0.76.8",
3133
"react-native-gesture-handler": "~2.20.2",
3234
"react-native-safe-area-context": "4.12.0",
3335
"react-native-screens": "~4.4.0",

0 commit comments

Comments
 (0)