Lottie-ios: Question : Is it possible to load remote json files into lottie lib ?

Created on 1 Apr 2017  路  9Comments  路  Source: airbnb/lottie-ios

Hi,

firstly thank you for this great work its make apps animations become amazing .

I just wonder if i have stored some json files in app backend ex : firebase storage , can i load this animation into my app via file URL or i have to download it first ?
any explanation would be much appreciated .

Thank you again

Most helpful comment

@HWSTS you can load from an URL.

LOTAnimationView *animation = [[LOTAnimationView alloc] initWithContentsOfURL:[NSURL URLWithString:URL]];
[self.view addSubview:animation];

All 9 comments

@HWSTS you can load from an URL.

LOTAnimationView *animation = [[LOTAnimationView alloc] initWithContentsOfURL:[NSURL URLWithString:URL]];
[self.view addSubview:animation];

well this is great, sorry i know this part related to android but how to load the same file in android ?

@HWSTS Here's my solution about Android:

https://github.com/airbnb/lottie-android/issues/338#issuecomment-403440038

I've also provided you a way to have a caching mechanism for this, using any solution you'd like, by having an optional listener.

Does anyone know how to load json files from firebase?

@SantiagoGaleano You can put very long json file on Firebase?

I have my animation .json in base of fire but I pass the url in the src of the lottie and it appears error

@SantiagoGaleano Sorry but it doesn't make sense. If the URL is to a file of json file, it should work as I wrote.
If it's not, you will have to do other things before, depending on what you did.

@AndroidDeveloperLB What I'm doing in ionic and on the way I'm passing the firebase route, you have facebook or some mail to be able to contact you thank you very much

@SantiagoGaleano Sorry but I lack the experience to understand what you mean

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JALsnipe picture JALsnipe  路  4Comments

rajeshbeats picture rajeshbeats  路  3Comments

webdale picture webdale  路  5Comments

petoye picture petoye  路  3Comments

WZBbiao picture WZBbiao  路  5Comments