rive-react-native icon indicating copy to clipboard operation
rive-react-native copied to clipboard

Asset Handler API Compatibility with React Native

Open RomualdPercereau opened this issue 1 year ago • 3 comments

Handling Assets with the Asset Handler API doesn't seems to be available with react-native.

Could you please provide any insights into whether there is an intended plan or roadmap for supporting the Asset Handler API for react-native in the near future?

Thank you for your work on this!

RomualdPercereau avatar Apr 23 '24 12:04 RomualdPercereau

Looks like there is a branch by @zplata which does this:

https://github.com/rive-app/rive-react-native/tree/bump-ios-android-oob

But it seems inactive. It would be great if we could get this soon as well.

yigityu avatar May 02 '24 13:05 yigityu

@zplata Any update on this ? 🙂

RomualdPercereau avatar Jul 03 '24 15:07 RomualdPercereau

@zplata I hope you are doing well, do you know if you are going to work again on it?

RomualdPercereau avatar Sep 11 '24 08:09 RomualdPercereau

Looks like the branch by @zplata is only iOS, no android support. Curious if the maintainers would accept a PR?

tslater avatar Nov 09 '24 23:11 tslater

I made a bit of progress on the android side, this is a simpler implementation that only supports remote asset urls: Branch Comparison

I could probably update the initialAssetsHandled prop to be a nested map of asset name to either an assetUrl or a bundledAssetName, using a different loader class for each

Traviskn avatar Nov 23 '24 22:11 Traviskn

ok I updated my branch to also support locally bundled assets, working in my testing with the example app. I might try to pull in the changes from @zplata's branch as well to see if I can get iOS working

Traviskn avatar Nov 24 '24 00:11 Traviskn

I pulled most of the changes from @zplata's branch over for iOS see branch comparison

it's working for local rive files and remote asset urls. It's still missing font support and apparently if you load a riv file from a url it doesn't accept the asset loader callback, might need to check rive-ios to see if that's really the case. On android I had to omit the file extension for bundled assets, for iOS we need to include the file extension. Will need to figure out a solution to make the bundled asset api match across platforms

Traviskn avatar Nov 26 '24 17:11 Traviskn

See https://github.com/rive-app/rive-react-native/pull/285 for latest movement. Your input is appreciated before we commit to an API and make a release.

HayesGordon avatar Jan 10 '25 16:01 HayesGordon

This has now been merged and released in v8.4.0

HayesGordon avatar Feb 05 '25 13:02 HayesGordon