Skip to content

Commit cc0a738

Browse files
orangec-atmac
andauthored
fix(ios): correct stateMachineUnsubscribe method name and signature (#30)
* fix(ios): correct stateMachineUnsubscribe method name and signature * fix(ios): align dotlottie-ios pod version with unsubscribe API --------- Co-authored-by: mac <mac@macui-Macmini.local>
1 parent 498b604 commit cc0a738

File tree

3 files changed

+85
-90
lines changed

3 files changed

+85
-90
lines changed

dotlottie-react-native.podspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Pod::Spec.new do |s|
1616

1717
s.source_files = "ios/**/*.{h,m,mm,swift}"
1818

19-
s.dependency 'LottieFiles-dotLottie-iOS', '~> 0.9'
19+
# stateMachineUnsubscribe(...) API is available from 0.11.1+
20+
s.dependency 'LottieFiles-dotLottie-iOS', '~> 0.11'
2021

2122
s.swift_version = '5.0'
2223

example/ios/Podfile.lock

Lines changed: 59 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
PODS:
22
- boost (1.84.0)
3-
- dotlottie-react-native (0.6.1):
3+
- dotlottie-react-native (0.7.0):
44
- boost
55
- DoubleConversion
66
- fast_float
77
- fmt
88
- glog
99
- hermes-engine
10-
- LottieFiles-dotLottie-iOS (~> 0.9)
10+
- LottieFiles-dotLottie-iOS (~> 0.11)
1111
- RCT-Folly
1212
- RCT-Folly/Fabric
1313
- RCTRequired
@@ -37,7 +37,7 @@ PODS:
3737
- hermes-engine (0.81.4):
3838
- hermes-engine/Pre-built (= 0.81.4)
3939
- hermes-engine/Pre-built (0.81.4)
40-
- LottieFiles-dotLottie-iOS (0.9.2)
40+
- LottieFiles-dotLottie-iOS (0.11.1)
4141
- RCT-Folly (2024.11.18.00):
4242
- boost
4343
- DoubleConversion
@@ -1778,8 +1778,6 @@ PODS:
17781778
- React-RCTFBReactNativeSpec
17791779
- ReactCommon/turbomodule/core
17801780
- SocketRocket
1781-
- react-native-safe-area-context (5.6.1):
1782-
- React-Core
17831781
- React-NativeModulesApple (0.81.4):
17841782
- boost
17851783
- DoubleConversion
@@ -2331,7 +2329,6 @@ DEPENDENCIES:
23312329
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
23322330
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
23332331
- React-microtasksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
2334-
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
23352332
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
23362333
- React-oscompat (from `../node_modules/react-native/ReactCommon/oscompat`)
23372334
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
@@ -2454,8 +2451,6 @@ EXTERNAL SOURCES:
24542451
:path: "../node_modules/react-native/ReactCommon"
24552452
React-microtasksnativemodule:
24562453
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
2457-
react-native-safe-area-context:
2458-
:path: "../node_modules/react-native-safe-area-context"
24592454
React-NativeModulesApple:
24602455
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
24612456
React-oscompat:
@@ -2521,78 +2516,77 @@ EXTERNAL SOURCES:
25212516

25222517
SPEC CHECKSUMS:
25232518
boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90
2524-
dotlottie-react-native: a324a9c4be1df30815052d86019dcaf93553c323
2519+
dotlottie-react-native: f8e52bc5024e0273b5a7460c0c550a83ad0e4ca5
25252520
DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb
25262521
fast_float: b32c788ed9c6a8c584d114d0047beda9664e7cc6
25272522
FBLazyVector: 941bef1c8eeabd9fe1f501e30a5220beee913886
25282523
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
25292524
glog: 5683914934d5b6e4240e497e0f4a3b42d1854183
25302525
hermes-engine: 35c763d57c9832d0eef764316ca1c4d043581394
2531-
LottieFiles-dotLottie-iOS: 1cd5d5e54ecfc4d15d5269fc4944615d05290f41
2532-
RCT-Folly: 846fda9475e61ec7bcbf8a3fe81edfcaeb090669
2526+
LottieFiles-dotLottie-iOS: e9b34e7cff6d04f5affd97336c2dab934b86e6fb
2527+
RCT-Folly: 59ec0ac1f2f39672a0c6e6cecdd39383b764646f
25332528
RCTDeprecation: c0ed3249a97243002615517dff789bf4666cf585
25342529
RCTRequired: 58719f5124f9267b5f9649c08bf23d9aea845b23
25352530
RCTTypeSafety: 4aefa8328ab1f86da273f08517f1f6b343f6c2cc
25362531
React: 2073376f47c71b7e9a0af7535986a77522ce1049
25372532
React-callinvoker: 751b6f2c83347a0486391c3f266f291f0f53b27e
2538-
React-Core: dff5d29973349b11dd6631c9498456d75f846d5e
2539-
React-CoreModules: c0ae04452e4c5d30e06f8e94692a49107657f537
2540-
React-cxxreact: 376fd672c95dfb64ad5cc246e6a1e9edb78dec4c
2533+
React-Core: 7195661f0b48e7ea46c3360ccb575288a20c932c
2534+
React-CoreModules: 14f0054ab46000dd3b816d6528af3bd600d82073
2535+
React-cxxreact: 7f602425c63096c398dac13cd7a300efd7c281ae
25412536
React-debug: 7b56a0a7da432353287d2eedac727903e35278f5
2542-
React-defaultsnativemodule: 393b81aaa6211408f50a6ef00a277847256dd881
2543-
React-domnativemodule: 5fb5829baa7a7a0f217019cbad1eb226d94f7062
2544-
React-Fabric: a17c4ae35503673b57b91c2d1388429e7cbee452
2545-
React-FabricComponents: a76572ddeba78ebe4ec58615291e9db4a55cd46a
2546-
React-FabricImage: d806eb2695d7ef355ec28d1a21f5a14ac26b1cae
2547-
React-featureflags: 1690ec3c453920b6308e23a4e24eb9c3632f9c75
2548-
React-featureflagsnativemodule: 7b7e8483fc671c5a33aefd699b7c7a3c0bdfdfec
2549-
React-graphics: ea146ee799dc816524a3a0922fc7be0b5a52dcc1
2550-
React-hermes: fcbdc45ecf38259fe3b12642bd0757c52270a107
2551-
React-idlecallbacksnativemodule: a353f9162eaa7ad787e68aba9f52a1cfa8154098
2552-
React-ImageManager: ec5cf55ce9cc81719eb5f1f51d23d04db851c86c
2553-
React-jserrorhandler: 594c593f3d60f527be081e2cace7710c2bd9f524
2554-
React-jsi: 59ec3190dd364cca86a58869e7755477d2468948
2555-
React-jsiexecutor: b87d78a2e8dd7a6f56e9cdac038da45de98c944f
2556-
React-jsinspector: b9204adf1af622c98e78af96ec1bca615c2ce2bd
2557-
React-jsinspectorcdp: 4a356fa69e412d35d3a38c44d4a6cc555c5931e8
2558-
React-jsinspectornetwork: 7820056773178f321cbf18689e1ffcd38276a878
2559-
React-jsinspectortracing: b341c5ef6e031a33e0bd462d67fd397e8e9cd612
2560-
React-jsitooling: 401655e05cb966b0081225c5201d90734a567cb9
2561-
React-jsitracing: 67eff6dea0cb58a1e7bd8b49243012d88c0f511e
2562-
React-logger: a3cb5b29c32b8e447b5a96919340e89334062b48
2563-
React-Mapbuffer: 9d2434a42701d6144ca18f0ca1c4507808ca7696
2564-
React-microtasksnativemodule: 75b6604b667d297292345302cc5bfb6b6aeccc1b
2565-
react-native-safe-area-context: 2243039f43d10cb1ea30ec5ac57fc6d1448413f4
2566-
React-NativeModulesApple: 879fbdc5dcff7136abceb7880fe8a2022a1bd7c3
2537+
React-defaultsnativemodule: 695d8a0b40f735edb3c4031e0f049e567fdac47a
2538+
React-domnativemodule: 6d66c1f61f277d008d98cae650ce2c025b89d3b9
2539+
React-Fabric: 997d4115d688f483cb409a1290171bff3c93dab4
2540+
React-FabricComponents: 8167e5e363ca3a3fe394d8afee355e4072bea1db
2541+
React-FabricImage: f8f9f2c97657116702acc670e3f4357bc842bed3
2542+
React-featureflags: dfb4d0d527d55dd968231370f6832b9197ee653d
2543+
React-featureflagsnativemodule: c63cfd8fe95cd98f12ebb37daa919c4544810a45
2544+
React-graphics: fd795f1c2a1133a08dde31725b20949edd545dca
2545+
React-hermes: 0a167bbb02c242664745e82154578c64e90a88e5
2546+
React-idlecallbacksnativemodule: 1798c6aa33ddc7c2e9fa3c3d67729728639889e9
2547+
React-ImageManager: c498ee6945dffacc82bfa175aa3264212f27c70b
2548+
React-jserrorhandler: 216951fea62fc26c600f4c96f0dc4fd53d1e7a9b
2549+
React-jsi: 9c27d27d3007b73c702ad3fd5a6166557c741020
2550+
React-jsiexecutor: 2b24f4ed4026344a27f717bf947a434cbbeeff7a
2551+
React-jsinspector: 02394b059c48805780f7d977366317a24168d00e
2552+
React-jsinspectorcdp: f4b6d5c5c9db05ef44d082716714f90cfeed96bb
2553+
React-jsinspectornetwork: e7c77d01b5f0664e24c0bec1aea27d5e3d7fb746
2554+
React-jsinspectortracing: aaa96a4e53abb88dc6d47da3b5744c710652fef9
2555+
React-jsitooling: 226e5f4147c7b6f1ae1954a8406ffa713f3da828
2556+
React-jsitracing: 8a2fbeaa9c53c3f0b23904ccffefc890eae48d71
2557+
React-logger: 1767babce2d28c3251039ce05556714a2c8c6ded
2558+
React-Mapbuffer: 33f678ee25b6c0ee2b01b1ecec08e3e02424cefe
2559+
React-microtasksnativemodule: 44b44a4d3cd6ffb85d928abf741acdc26722de2e
2560+
React-NativeModulesApple: b5d18bc109c45c9a1c6b71664991b5cc3adc4e48
25672561
React-oscompat: 93b5535ea7f7dff46aaee4f78309a70979bdde9d
2568-
React-perflogger: 5536d2df3d18fe0920263466f7b46a56351c0510
2569-
React-performancetimeline: 9041c53efa07f537164dcfe7670a36642352f4c2
2562+
React-perflogger: a03d913e3205b00aee4128082abe42fd45ce0c98
2563+
React-performancetimeline: 9b5986cc15afafb9bf246d7dd55bdd138df94451
25702564
React-RCTActionSheet: 42195ae666e6d79b4af2346770f765b7c29435b9
2571-
React-RCTAnimation: fa103ccc3503b1ed8dedca7e62e7823937748843
2572-
React-RCTAppDelegate: 2ee875077ee5b5a6e48aa2700fc3c18c6d118612
2573-
React-RCTBlob: 0fa9530c255644db095f2c4fd8d89738d9d9ecc0
2574-
React-RCTFabric: 4b4123f8e0b919e298cc41ea17c7fad9446dc8c7
2575-
React-RCTFBReactNativeSpec: 50be51842148dd53ea44673a4787ebb90dbdfe4f
2576-
React-RCTImage: ba824e61ce2e920a239a65d130b83c3a1d426dff
2577-
React-RCTLinking: d2dc199c37e71e6f505d9eca3e5c33be930014d4
2578-
React-RCTNetwork: 87137d4b9bd77e5068f854dd5c1f30d4b072faf6
2579-
React-RCTRuntime: c8578e980313bdb4eed18622f2fb2568612b79e8
2580-
React-RCTSettings: 71f5c7fd7b5f4e725a4e2114a4b4373d0e46048f
2581-
React-RCTText: b94d4699b49285bee22b8ebf768924d607eccee3
2582-
React-RCTVibration: 6e3993c4f6c36a3899059f9a9ead560ddaf5a7d7
2565+
React-RCTAnimation: 5c10527683128c56ff2c09297fb080f7c35bd293
2566+
React-RCTAppDelegate: 36d71b04a7ba1143fa783ce4840a04ebd9379d73
2567+
React-RCTBlob: 6e3757bdd7dce6fd9788c0dd675fd6b6c432db9d
2568+
React-RCTFabric: 093b280be70e5c9f871830c6a628f53bf2c8038b
2569+
React-RCTFBReactNativeSpec: 59f4ad68294512b75a8b213dd219df70d3d17fc5
2570+
React-RCTImage: a3482fe1ae562d1bab08b42d4670a7c9a21813cd
2571+
React-RCTLinking: d82b9adb141aef9d2b38d446b837ae7017ab60aa
2572+
React-RCTNetwork: fa9350dd99354c5695964f589bd4790bdd4f6a85
2573+
React-RCTRuntime: 50868a908922c3a331f9d0249c934638e067a890
2574+
React-RCTSettings: b7f4a03f44dba1d3a4dc6770843547b203ca9129
2575+
React-RCTText: 91dc597a5f6b27fd1048bb287c41ea05eeca9333
2576+
React-RCTVibration: 27b09ddf74bddfa30a58d20e48f885ea6ed6c9d9
25832577
React-rendererconsistency: b4785e5ed837dc7c242bbc5fdd464b33ef5bfae7
2584-
React-renderercss: e6fb0ba387b389c595ffa86b8b628716d31f58dc
2585-
React-rendererdebug: 60a03de5c7ea59bf2d39791eb43c4c0f5d8b24e3
2586-
React-RuntimeApple: 3df6788cd9b938bb8cb28298d80b5fbd98a4d852
2587-
React-RuntimeCore: fad8adb4172c414c00ff6980250caf35601a0f5d
2588-
React-runtimeexecutor: d2db7e72d97751855ea0bf5273d2ac84e5ea390c
2589-
React-RuntimeHermes: 04faa4cf9a285136a6d73738787fe36020170613
2590-
React-runtimescheduler: f6a1c9555e7131b4a8b64cce01489ad0405f6e8d
2591-
React-timing: 1e6a8acb66e2b7ac9d418956617fd1fdb19322fd
2592-
React-utils: 52bbb03f130319ef82e4c3bc7a85eaacdb1fec87
2593-
ReactAppDependencyProvider: 433ddfb4536948630aadd5bd925aff8a632d2fe3
2594-
ReactCodegen: 1d05923ad119796be9db37830d5e5dc76586aa00
2595-
ReactCommon: 394c6b92765cf6d211c2c3f7f6bc601dffb316a6
2578+
React-renderercss: cef3f26df2ddec558ce3c0790fc574b4fb62ce67
2579+
React-rendererdebug: e68433ae67738caeb672a6c8cc993e9276b298a9
2580+
React-RuntimeApple: dc1d4709bf847bc695dbe6e8aaf3e22ef25aef02
2581+
React-RuntimeCore: ca3473c8b6578693fa3bad4d44240098d49d6723
2582+
React-runtimeexecutor: 0db3ca0b09cd72489cef3a3729349b3c2cf13320
2583+
React-RuntimeHermes: f92cabaf97ef2546a74360eddfc1c74a34cb9ff8
2584+
React-runtimescheduler: 06aea75069e0d556a75d258bfc89eb0ebd5d557e
2585+
React-timing: 1a90df9a04d8e7fd165ff7fa0918b9595c776373
2586+
React-utils: 92115441fb55ce01ded4abfb5e9336a74cd93e9c
2587+
ReactAppDependencyProvider: b20fba6c3d091a393925890009999472c8f94d95
2588+
ReactCodegen: 58dc2eb138a27145826ad7d5568610159dfcadee
2589+
ReactCommon: 00df7b9f859c9d02181844255bb89a8bca544374
25962590
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
25972591
Yoga: a3ed390a19db0459bd6839823a6ac6d9c6db198d
25982592

ios/DotlottieReactNativeViewManager.swift

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import SwiftUI
3939
@Published var animation: DotLottieAnimation?
4040
var observer: DotLottieEventObserver?
4141
var stateMachineObserver: DotLottieStateMachineObserver?
42-
42+
4343
func createAnimation() {
4444
// Clean up existing animation
4545
cleanupAnimation()
@@ -128,7 +128,7 @@ import SwiftUI
128128

129129
// Unsubscribe state machine observer if it exists
130130
if let stateMachineObserver = self.stateMachineObserver, let animation = self.animation {
131-
_ = animation.stateMachineUnSubscribe(observer: stateMachineObserver)
131+
_ = animation.stateMachineUnsubscribe(stateMachineObserver)
132132
}
133133

134134
self.observer = nil
@@ -292,10 +292,10 @@ class DotlottieReactNativeViewManager: RCTViewManager {
292292
return DotlottieReactNativeView()
293293
}
294294

295-
296-
297-
298-
295+
296+
297+
298+
299299
@objc
300300
func pause(_ node:NSNumber) {
301301
DispatchQueue.main.async {
@@ -315,7 +315,7 @@ class DotlottieReactNativeViewManager: RCTViewManager {
315315
}
316316
}
317317
}
318-
318+
319319
@objc
320320
func play(_ node:NSNumber) {
321321
DispatchQueue.main.async {
@@ -327,23 +327,23 @@ class DotlottieReactNativeViewManager: RCTViewManager {
327327
let _ = animation.play()
328328
}
329329
}
330-
330+
331331
@objc
332332
func setLoop(_ node:NSNumber, loop:Bool) {
333333
DispatchQueue.main.async {
334334
let dotLottieView = self.bridge.uiManager.view(forReactTag: node) as! DotlottieReactNativeView
335335
_ = dotLottieView._animation?.setLoop(loop: loop)
336336
}
337337
}
338-
338+
339339
@objc func setSpeed(_ node:NSNumber, speed:NSNumber) {
340340
DispatchQueue.main.async {
341341
let convertedSpeed = Float(truncating: speed)
342342
let dotLottieView = self.bridge.uiManager.view(forReactTag: node) as! DotlottieReactNativeView
343343
_ = dotLottieView._animation?.setSpeed(speed: convertedSpeed)
344344
}
345345
}
346-
346+
347347
@objc func setFrame(_ node:NSNumber, frame:NSNumber) {
348348
DispatchQueue.main.async {
349349
let convertedFrame = Float(truncating: frame)
@@ -434,17 +434,17 @@ class DotlottieReactNativeViewManager: RCTViewManager {
434434
try? dotLottieView._animation?.loadAnimationById(String(animationId))
435435
}
436436
}
437-
437+
438438
@objc func setFrameInterpolation(_ node:NSNumber, useFrameInterpolation:Bool) {
439439
DispatchQueue.main.async {
440440
let dotLottieView = self.bridge.uiManager.view(forReactTag: node) as! DotlottieReactNativeView
441441
_ = dotLottieView._animation?.setFrameInterpolation(useFrameInterpolation)
442442
}
443443
}
444-
444+
445445
@objc func setPlayMode(_ node:NSNumber, mode:NSNumber) {
446446
DispatchQueue.main.async {
447-
447+
448448
let actualMode: Mode = {
449449
switch mode {
450450
case 0: return .forward
@@ -455,29 +455,29 @@ class DotlottieReactNativeViewManager: RCTViewManager {
455455
return .forward
456456
}
457457
}()
458-
458+
459459
let dotLottieView = self.bridge.uiManager.view(forReactTag: node) as! DotlottieReactNativeView
460460
_ = dotLottieView._animation?.setMode(mode: actualMode)
461461
}
462462
}
463-
463+
464464
@objc func setMarker(_ node:NSNumber, marker:NSString) {
465465
DispatchQueue.main.async {
466466
let dotLottieView = self.bridge.uiManager.view(forReactTag: node) as! DotlottieReactNativeView
467467
_ = dotLottieView._animation?.setMarker(marker: String(marker))
468468
}
469469
}
470-
470+
471471
@objc func resize(_ node:NSNumber, width:NSNumber, height:NSNumber) {
472472
DispatchQueue.main.async {
473473
let dotLottieView = self.bridge.uiManager.view(forReactTag: node) as! DotlottieReactNativeView
474474
_ = dotLottieView._animation?.resize(width: Int(truncating: width), height: Int(truncating: height))
475475
}
476476
}
477-
478-
479-
480-
477+
478+
479+
480+
481481
@objc override static func requiresMainQueueSetup() -> Bool {
482482
return true
483483
}
@@ -644,7 +644,7 @@ class DotlottieReactNativeView: UIView {
644644
}
645645
}
646646
}
647-
647+
648648
@objc var speed: NSNumber = 1 {
649649
didSet {
650650
performIfActive {
@@ -744,20 +744,20 @@ class DotlottieReactNativeView: UIView {
744744
dataStore.onPlay = onPlay
745745
}
746746
}
747-
747+
748748
@objc var onLoop: RCTDirectEventBlock = {_ in} {
749749
didSet{
750750
dataStore.onLoop = onLoop
751751
}
752752
}
753753

754-
754+
755755
@objc var onLoadError: RCTDirectEventBlock = {_ in} {
756756
didSet{
757757
dataStore.onLoadError = onLoadError
758758
}
759759
}
760-
760+
761761
@objc var onLoad: RCTDirectEventBlock = {_ in} {
762762
didSet{
763763
dataStore.onLoad = onLoad

0 commit comments

Comments
 (0)