diff --git a/example/ios/Assets/rating.riv b/example/ios/Assets/rating.riv new file mode 100644 index 0000000..330f7e9 Binary files /dev/null and b/example/ios/Assets/rating.riv differ diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 6be96e0..3f19974 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -489,8 +489,8 @@ PODS: - React-perflogger (= 0.72.3) - rive-react-native (6.0.4): - React-Core - - RiveRuntime (= 5.1.6) - - RiveRuntime (5.1.6) + - RiveRuntime (= 5.3.1) + - RiveRuntime (5.3.1) - RNCMaskedView (0.2.9): - React-Core - RNCPicker (1.16.8): @@ -693,9 +693,9 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - boost: a7c83b31436843459a1961bfd74b96033dc77234 + boost: 57d2868c099736d80fcd648bf211b4431e51a558 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 + DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 FBLazyVector: 4cce221dd782d3ff7c4172167bba09d58af67ccb FBReactNativeSpec: c6bd9e179757b3c0ecf815864fae8032377903ef Flipper: 6edb735e6c3e332975d1b17956bcc584eccf5818 @@ -707,7 +707,7 @@ SPEC CHECKSUMS: Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 FlipperKit: 2efad7007d6745a3f95e4034d547be637f89d3f6 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - glog: 5337263514dd6f09803962437687240c5dc39aa4 + glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b hermes-engine: 10fbd3f62405c41ea07e71973ea61e1878d07322 libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c @@ -744,8 +744,8 @@ SPEC CHECKSUMS: React-runtimescheduler: 837c1bebd2f84572db17698cd702ceaf585b0d9a React-utils: bcb57da67eec2711f8b353f6e3d33bd8e4b2efa3 ReactCommon: 3ccb8fb14e6b3277e38c73b0ff5e4a1b8db017a9 - rive-react-native: 2bbbdb03edbb7f1f9ffda06bf7bcd0a2f1c2a4d5 - RiveRuntime: b019064a8668431b80389f83b5a2eb012e034c01 + rive-react-native: a932751960b201581fd0dd91371ac400991e6201 + RiveRuntime: 63fe0407ab96ab1796c492d1e584a3b766e80693 RNCMaskedView: 949696f25ec596bfc697fc88e6f95cf0c79669b6 RNCPicker: 0991c56da7815c0cf946d6f63cf920b25296e5f6 RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211 @@ -757,4 +757,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 5ef3edaac0021600a1e0462aa4c2c8c364c536b3 -COCOAPODS: 1.11.3 +COCOAPODS: 1.11.2 diff --git a/example/ios/RiveReactNativeExample.xcodeproj/project.pbxproj b/example/ios/RiveReactNativeExample.xcodeproj/project.pbxproj index ed159ca..86cc5ea 100644 --- a/example/ios/RiveReactNativeExample.xcodeproj/project.pbxproj +++ b/example/ios/RiveReactNativeExample.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ E5637D7A292BD27F000CBC1E /* skills_listener.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5637D79292BD26D000CBC1E /* skills_listener.riv */; }; E5A17A90299AA0F5008CC433 /* avatars.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5A17A8F299AA0F5008CC433 /* avatars.riv */; }; E5F3FC4029B2661500D6D265 /* switch.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5F3FC3F29B2661500D6D265 /* switch.riv */; }; + E5FC4EAA2ABB975100D98158 /* rating.riv in Resources */ = {isa = PBXBuildFile; fileRef = E5FC4EA92ABB975100D98158 /* rating.riv */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -95,6 +96,7 @@ E5637D79292BD26D000CBC1E /* skills_listener.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = skills_listener.riv; sourceTree = ""; }; E5A17A8F299AA0F5008CC433 /* avatars.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = avatars.riv; sourceTree = ""; }; E5F3FC3F29B2661500D6D265 /* switch.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = switch.riv; sourceTree = ""; }; + E5FC4EA92ABB975100D98158 /* rating.riv */ = {isa = PBXFileReference; lastKnownFileType = file; path = rating.riv; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; /* End PBXFileReference section */ @@ -250,6 +252,7 @@ 9DBF1CC42684937E0008391A /* v6_file.riv */, E5F3FC3F29B2661500D6D265 /* switch.riv */, 9D879D0C265BF2A400D01424 /* ui_swipe_left_to_delete.riv */, + E5FC4EA92ABB975100D98158 /* rating.riv */, E5A17A8F299AA0F5008CC433 /* avatars.riv */, E5637D79292BD26D000CBC1E /* skills_listener.riv */, 9D879D0A26578A5E00D01424 /* artboard_animations.riv */, @@ -400,6 +403,7 @@ buildActionMask = 2147483647; files = ( 9D879D00265642BA00D01424 /* truck_v7.riv in Resources */, + E5FC4EAA2ABB975100D98158 /* rating.riv in Resources */, 042FD22726B81BD1004556A3 /* constrained.riv in Resources */, 9D879D0B26578A5E00D01424 /* artboard_animations.riv in Resources */, E5637D7A292BD27F000CBC1E /* skills_listener.riv in Resources */, diff --git a/example/src/App.tsx b/example/src/App.tsx index 5d93ce1..07ce9e1 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -14,6 +14,7 @@ import ErrorNotHandled from './ErrorNotHandled'; import ErrorHandledManually from './ErrorHandledManually'; import MeshExample from './MeshExample'; import DynamicText from './DynamicText'; +import Events from './Events'; const Stack = createStackNavigator(); @@ -33,6 +34,7 @@ export default function App() { + (null); + const [eventMessage, setEventMessage] = useState(''); + + return ( + + + { + const eventProperties = event.properties; + if (eventProperties?.message) { + setEventMessage(eventProperties.message as string); + } + if ('url' in event) { + Linking.openURL((event as RiveOpenUrlEvent).url || ''); + } + }} + resourceName={'rating'} + /> + {eventMessage} + + + ); +} + +const styles = StyleSheet.create({ + safeAreaViewContainer: { + flex: 1, + }, + container: { + flexGrow: 1, + alignItems: 'center', + justifyContent: 'center', + marginBottom: 150, + }, + box: { + width: '100%', + height: 500, + marginVertical: 20, + }, +}); diff --git a/example/src/Home.tsx b/example/src/Home.tsx index 9b4f0b7..539080e 100644 --- a/example/src/Home.tsx +++ b/example/src/Home.tsx @@ -71,6 +71,14 @@ export default function Home({ navigation }) { State Machine + +