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

OOB Asset Support #278

Closed
wants to merge 5 commits into from
Closed

Conversation

Traviskn
Copy link

This adds support for out of band assets as requested in #236 and #271.

The example rive file and assets as well as most of the iOS implementation code are from this branch by @zplata https://github.com/rive-app/rive-react-native/tree/bump-ios-android-oob

A few quirks are:

  • If using bundled assets, you must include the file extension on iOS, but must omit the file extension on Android.
  • You must also your assets into the res/raw directory on Android.
  • Font asset support is not yet complete on iOS

I would love feedback, I will see about adding font asset support to the iOS implementation as well

also improve documentation and example for asset file name
@Traviskn
Copy link
Author

I've updated my branch with support for font assets on iOS. I've also updated the docs to explain the platform differences between asset names on iOS and Android. I've also updated the example to work cross platform

@HayesGordon
Copy link
Contributor

Hi @Traviskn, this is great thanks for the contribution.

I have a local version of out of band assets support that expands on what Zach did in the above mentioned branch. It also allows for assets to be loaded in using require instead of updating Xcode/Android-Studio.

I'd need to clean up the initial draft and can tag you to review that - I'll aim for next week. Would love to get your, and others, input on which approach is best.

@Traviskn
Copy link
Author

@HayesGordon that sounds great, I’ll look forward to seeing your PR! Passing in the asset reference via require sounds like a great api

@tslater
Copy link

tslater commented Dec 9, 2024

@HayesGordon will your API be similar to the one for web? I finally found on discord a discussion of how to reload assets after the initial load by maintaining a reference to the asset object in the callback. I've tested here:
https://codesandbox.io/p/sandbox/out-of-band-react-typescript-re-load-8wqth3?file=%2Fsrc%2FApp.tsx%3A13%2C1&workspaceId=ws_NfoYyUpqSy5SuDSXnhT3eT

Ideally we could do the same in ReactNative?

@evelant
Copy link

evelant commented Jan 7, 2025

@HayesGordon any movement on OOB assets for react native? The RN sdk seems to be lagging significantly behind the other sdks. OOB assets were released for the other SDKs 15 months ago.

@tslater
Copy link

tslater commented Jan 7, 2025

@HayesGordon any chance we could get on a call? We'd like to contribute more but would like some coordination if possible (I'm working with Travis).

@HayesGordon
Copy link
Contributor

Hey all sorry for dropping the ball on this one!

I've created a new branch with OOB support: #285

Let's take the discussion there. Your feedback is greatly appreciated.

@tslater we can definitely meet up. You can reach me at [email protected]

This PR only includes iOS. Android is almost complete just wrapping up a few things, I can hopefully push that tomorrow.

@Traviskn
Copy link
Author

Closing in favor of #285

@Traviskn Traviskn closed this Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants