Asset Handler API Compatibility with React Native
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!
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.
@zplata Any update on this ? 🙂
@zplata I hope you are doing well, do you know if you are going to work again on it?
Looks like the branch by @zplata is only iOS, no android support. Curious if the maintainers would accept a PR?
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
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
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
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.
This has now been merged and released in v8.4.0