From 5969151936520e88a302332bfba14dec97d7cfca Mon Sep 17 00:00:00 2001 From: Zach Plata Date: Wed, 20 Sep 2023 16:17:45 -0500 Subject: [PATCH] feat: bump ios dependency to support Rive Events --- example/ios/Assets/rating.riv | Bin 0 -> 16204 bytes example/ios/Podfile.lock | 16 ++--- .../project.pbxproj | 4 ++ example/src/App.tsx | 2 + example/src/Events.tsx | 56 ++++++++++++++++++ example/src/Home.tsx | 8 +++ ios/RiveReactNativeView.swift | 17 ++++++ ios/RiveReactNativeViewManager.m | 1 + rive-react-native.podspec | 2 +- src/Rive.tsx | 22 +++++++ src/types.ts | 18 ++++++ 11 files changed, 137 insertions(+), 9 deletions(-) create mode 100644 example/ios/Assets/rating.riv create mode 100644 example/src/Events.tsx diff --git a/example/ios/Assets/rating.riv b/example/ios/Assets/rating.riv new file mode 100644 index 0000000000000000000000000000000000000000..330f7e91c741daeea0b15d7e77e1e19c058007cc GIT binary patch literal 16204 zcmeHOdyJIT6~Eu?4(kgR(9#`ZmnjA@1&T0iEU3G)tRSSeCi1Y)Y!-GF2(W`QgMf{? z#Z(DF;|uEp4gWNiYT8;&Y)y;{B(zqjT3@ZU7PMMhX~kHL^^ekXe)ryU?)S~?vMQ}; z-DGCYIrrZ4o!>dw$(_kK7vOhWyy&Sy~9gNbsWcU2P0E|(pL-XvhAhHl44h>+obB#3o2cua@q_x=CY0vi*H@mVe0BnWMOAZ z=dxABb?Ip2w-(m5jp8@zbW(>InNDRRlTOz)-8cR-6El6ehFxQg$+kl@`%rUxX6vqR z>;!kkRx>*@sd?f~?Qq4`zIGD*Fz>qG#oeE8*ADlM-+DSJy~gXiYiFVZY1pY6=n=aT zk02X(4B0R`{Y*6BF#Qpz;SN-JO;>4UnPBxrKWiJsZyr`-V^7l$`pK@5{A%jkv%fvl z|I7V532|fNMfXkOrjz-VXnLXX(ML!;hF|d}l4ST5NJpoijV8SJ9+@EX?A_qb|zk829uJ+7(B-7HdfbN7V1S*f}k9pdhW25~nY5qCFi5O+W4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g6Z0_0hk_2O}Zd7L(D_{{xJ=TgU(a literal 0 HcmV?d00001 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 + +