Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(guides): add an Expo guide #2296

Merged
merged 5 commits into from
Apr 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions docs/docs/guides/with-expo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
sidebar_position: 4
dctalbot marked this conversation as resolved.
Show resolved Hide resolved
---

# Developing with Expo

Expo is a popular development platform in the react-native ecosystem.
dctalbot marked this conversation as resolved.
Show resolved Hide resolved

## Custom Entrypoint

By default, Expo points to an entrypoint in the `node_modules` package. The path for this is configured in the `"main"` field of `package.json`. To configure the Playback Service in this entrypoint file:

1. Copy the file
dctalbot marked this conversation as resolved.
Show resolved Hide resolved

```
cp node_modules/expo/AppEntry.js AppEntry.js
```

2. Update the `"main"` field of `package.json` to the new location e.g. `"AppEntry.js"`
3. Edit the file to have it import your app code, and configure the Playback Service.


## Streaming HTTP

On newer versions of Android, HTTP streaming is disallowed by default (HTTPS is OK). However, it is only disallowed in production builds which can make this issue hard to diagnose.

To allow HTTP, you must first install the [`expo-build-properties` package](https://docs.expo.dev/versions/latest/sdk/build-properties).

```
expo install expo-build-properties
```

Then add this configuration in `app.json`:

```json
...
"plugins": [
[
"expo-build-properties",
{
"android": {
"usesCleartextTraffic": true
}
}
]
]
...
```