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

Out of band assets #285

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
25 changes: 23 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ Follow dependency installation instructions from the [React Native docs here](ht
export JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home`
```

### Testing in a new Expo project
1. In `rive-react-native` run `npm pack` which will create `rive-react-native-x.y.z.tgz`
2. Create a new Expo project and [prebuild](https://docs.expo.dev/workflow/continuous-native-generation/#usage) (formerly eject) it
3. In the Podfile set the minimum platform to 14: `platform :ios, podfile_properties['ios.deploymentTarget'] || '14.0'`
4. Add this to your `package.json` dependencies: `"rive-react-native": "file:../rive-react-native/rive-react-native-x.y.z.tgz"` (adjust the path and version numbers as needed) and run `npm i`
5. Add a Rive component in `index.tsx`:

```jsx
import Rive, { Alignment, Fit, RiveRef } from 'rive-react-native'
...
<Rive
url='https://cdn.rive.app/animations/vehicles.riv'
fit={Fit.Contain}
alignment={Alignment.Center}
artboardName={'Truck'}
style={{ width: 200, height: 200 }}
autoplay={true}
/>
```
6. Run with `npm run start`

### M1 considerations

If you're running on an M1, you may need to run terminal-based commands off [Rosetta](https://www.courier.com/blog/tips-and-tricks-to-setup-your-apple-m1-for-development/) as it may not support new M1 architecture.
Expand Down Expand Up @@ -107,7 +128,7 @@ When an underlying runtime like [rive-ios](https://github.com/rive-app/rive-ios)
Before running `yarn` at the root level of the project, set the appropriate version of the iOS runtime in `rive-react-native.podspec` at the root of the folder:

```
s.dependency "RiveRuntime", "x.x.x"
s.dependency "RiveRuntime", "x.y.z"
```

In the example folder, run the following command to update the example project to retrieve the expected `RiveRuntime` dependency you're upgrading to:
Expand All @@ -121,7 +142,7 @@ pod update RiveRuntime
In the top-level `android` folder, change the dependency version in `build.gradle` to the version you're looking to upgrade to in the dependencies:

```
implementation 'app.rive:rive-android:8.2.1'
implementation 'app.rive:rive-android:x.y.z'
```

### Debugging against local rive-android
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ Check out the `example/` folder to run an example application using the Rive Rea
- Displaying single or multiple animations / artboards on one component
- Setting up and maniuplating a state machine via inputs
- ...and more!

Steps:
1. Run `yarn bootstrap`
2. Run `yarn example start`

iOS:
- You may need to run `pod install` (first time) or `pod update RiveRuntime` (updates to the underlying Rive iOS runtime) in the `example/iOS` folder to get the runtime installed or updated

## Migration Guides

Expand Down
Loading
Loading