You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When providing an invalid URL to the Rive component on iOS and calling .play, the application crashes instead of handling the error gracefully. It would be beneficial to have a fallback mechanism or error handling similar to what is currently implemented on Android, which provides a clear error message without causing a crash.
Steps to Reproduce
Pass an invalid URL to the Rive component in Expo. e.g.:
Try to test the animation inside your emulator/test device.
Expected Behavior
When an invalid URL is passed to the Rive component, the application should not crash when trying to call .play on the riveRef. Instead, it should handle the error by providing an appropriate message, allowing developers to implement a fallback UI or retry mechanism.
Actual Behavior
The application crashes when the Rive component on iOS receives an invalid URL and is being played using the .play function. No error message is logged. Using the autoplay prop does not cause the animation to crash.
Android Error Handling (for reference)
On Android, the error is handled correctly, and the following message is presented:
json
{
"type": "IncorrectRiveFileUrl",
"message": "Unable to download Rive file from: invalidUrl"
}
Additional Information
rive-react-native: [6.1.1]
react-native: [0.71.14]
expo: [48.0.21]
Platform: iOS (Android works as expected)
reproduced on: [both real iOS Device and Simulator]
environment: [DEV]
It would be greatly appreciated if the same error handling implemented for Android could be applied to the iOS side to improve the robustness of the Rive component in various network conditions or potential server outages.
The text was updated successfully, but these errors were encountered:
niklasmachacek
changed the title
Graceful handling of invalid Rive file URLs for iOS (Expo)
Graceful handling of invalid Rive file URLs for iOS after calling .play (Expo)
Nov 29, 2023
Description
When providing an invalid URL to the Rive component on iOS and calling
.play
, the application crashes instead of handling the error gracefully. It would be beneficial to have a fallback mechanism or error handling similar to what is currently implemented on Android, which provides a clear error message without causing a crash.Steps to Reproduce
.play
on theriveRef.current
Expected Behavior
When an invalid URL is passed to the Rive component, the application should not crash when trying to call
.play
on theriveRef
. Instead, it should handle the error by providing an appropriate message, allowing developers to implement a fallback UI or retry mechanism.Actual Behavior
The application crashes when the Rive component on iOS receives an invalid URL and is being played using the
.play
function. No error message is logged. Using theautoplay
prop does not cause the animation to crash.Android Error Handling (for reference)
On Android, the error is handled correctly, and the following message is presented:
json
{
"type": "IncorrectRiveFileUrl",
"message": "Unable to download Rive file from: invalidUrl"
}
Additional Information
It would be greatly appreciated if the same error handling implemented for Android could be applied to the iOS side to improve the robustness of the Rive component in various network conditions or potential server outages.
The text was updated successfully, but these errors were encountered: