Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support other assets and not just images #29

Open
JulianBissekkou opened this issue Apr 6, 2023 · 2 comments
Open

Support other assets and not just images #29

JulianBissekkou opened this issue Apr 6, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@JulianBissekkou
Copy link

I am developing a live activity that needs to get a .json file which will be used to render a lottie animation. This is not an image and therefore I can't use LiveActivityImage.

My proposal would be to create LiveActivityFileAsset.
This can be resolved to the actual asset in kotlin and swift using

// registrar is of type "FlutterPluginRegistrar"
let key = registrar?.lookupKey(forAsset: "Images/topImage.png")
let topPath = Bundle.main.path(forResource: key, ofType: nil)!

Same should work for android.

You can then grab the asset using

let myAssetPath = sharedDefault.string(forKey: "someAsset")
@istornz
Copy link
Owner

istornz commented Apr 6, 2023

Hello, thanks for the suggestion but I don't think it's possible...
In the official Apple documentation, it's written:

The updated dynamic data for both ActivityKit updates and ActivityKit push notifications can’t exceed 4KB in size.

Do you have tried in a full native project to test if it's feasible ?
Thanks

@istornz istornz added the enhancement New feature or request label Apr 6, 2023
@JulianBissekkou
Copy link
Author

JulianBissekkou commented Apr 6, 2023

I didn't do any testing. Just to clarify: I don't want to send the whole data over to my live activity. I want to access a filepath that is stored in my main app.
The 4KB transfer limit shouldn't be a deal here if i am able to configure that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants