Skip to content

Commit 5cee6cb

Browse files
committed
fix(ios): update to latest sdk
1 parent 26e7853 commit 5cee6cb

File tree

3 files changed

+196
-79
lines changed

3 files changed

+196
-79
lines changed

plugin/platforms/ios/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pod 'lottie-ios', :git => 'https://github.com/farfromrefug/lottie-ios.git', :branch => "3.4.2"
2-
pod 'dotLottie', :git => 'https://github.com/farfromrefug/dotlottie-ios.git', :branch => "2.0.0"
1+
pod 'lottie-ios', :git => 'https://github.com/farfromrefug/lottie-ios.git', :branch => "4.3.3"
2+
# pod 'dotLottie', :git => 'https://github.com/farfromrefug/dotlottie-ios.git', :branch => "2.1.0"

src/lottie.ios.ts

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,11 @@ export class LottieView extends LottieViewBase {
4646
this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithJson(src);
4747
} else if (src.startsWith(Utils.RESOURCE_PREFIX)) {
4848
const resName = src.replace(Utils.RESOURCE_PREFIX, '');
49-
if (resName.endsWith('.lottie')) {
50-
DotLottie.objcLoadWithNameShouldCacheCompletion(resName.replace('.lottie', ''), true, (animation) => {
51-
this.nativeViewProtected.animation = animation;
52-
});
53-
} else {
54-
this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithNameBundle(
55-
resName.replace('.json', ''),
56-
NSBundle.mainBundle
57-
);
58-
}
49+
50+
this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithNameBundle(
51+
resName.replace('.json', '').replace('.lottie', ''),
52+
NSBundle.mainBundle
53+
);
5954
} else {
6055
if (src[0] === '~') {
6156
src = `${path.join(appPath, src.substring(2))}`;
@@ -65,14 +60,11 @@ export class LottieView extends LottieViewBase {
6560
}
6661
if (!src.startsWith('file:/') && src[0] !== '/') {
6762
// seen as res
68-
this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithNameBundle(
63+
this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithNameSubdirectoryBundle(
6964
src.replace('.json', '').replace('.lottie', ''),
65+
null,
7066
NSBundle.mainBundle
7167
);
72-
} else if (src.endsWith('.lottie')) {
73-
DotLottie.objcLoadFromShouldCacheCompletion(NSURL.URLWithString(src), true, (animation) => {
74-
this.nativeViewProtected.animation = animation;
75-
});
7668
} else {
7769
this.nativeViewProtected.compatibleAnimation = CompatibleAnimation.alloc().initWithFilepath(src);
7870
}

0 commit comments

Comments
 (0)