简体   繁体   English

如何减少自定义贴纸应用程序的文件大小

[英]How To Reduce File Size For A Custom Sticker App

I've built a custom iMessage sticker app that has hundreds of stickers and requires an in-app purchase to unlock them. 我建立了一个自定义的iMessage贴纸应用程序,该应用程序具有数百个贴纸,需要在应用程序内购买才能解锁它们。 As I'm adding more and more stickers, my app size is obviously increasing. 随着我添加越来越多的贴纸,我的应用程序大小显然正在增加。 I'm doing my best to compress images and keep the file size down but trying to think of other ways to keep a low file size. 我正在尽力压缩图像并减小文件大小,但尝试尝试其他方法来减小文件大小。

I came across this sticker app: 我遇到了这个贴纸应用程序:

Apple: https://itunes.apple.com/us/app/mojilala-unlimited-10000+/id1153431461?mt=8&_branch_match_id=598750316922589452 苹果: https//itunes.apple.com/us/app/mojilala-unlimited-10000+/id1153431461?mt = 8&_branch_match_id = 598750316922589452

Android: https://play.google.com/store/apps/details?id=com.leo.stickers&hl=en Android: https//play.google.com/store/apps/details?id = com.leo.stickers&hl = zh-CN

It has 42,000 stickers but the file size is only around 22MB. 它有42,000个贴纸,但是文件大小只有22MB左右。 It works like a normal sticker app too, you can't tell a difference. 它也像普通的贴纸应用程序一样工作,您无法分辨。

I'm very new to coding and have no idea what to even research to have something like this for my app. 我对编码非常陌生,甚至不知道该如何研究才能在我的应用中使用类似的东西。 Could the stickers be hosted on a WordPress site and a link to the image be sent to the app somehow? 贴纸可以托管在WordPress网站上,并且以某种方式将图像的链接发送到应用程序吗? Is this something Firebase could do? 这是Firebase可以做的事情吗?

I'm not sure how the above mentioned app works. 我不确定上述应用程序的工作方式。 But I think you can use the following approaches: 但我认为您可以使用以下方法:

  • Only add the free stickers to the app, and download the others from the server when user purchases it. 仅将免费贴纸添加到应用程序,然后在用户购买时从服务器下载其他贴纸。
  • Slightly different approach from the above one, add the low resolution thumbnails to the app. 与上述方法略有不同,将低分辨率缩略图添加到应用中。 When user launches your app for the first time download the actual stickers in the background and show them after the successful download. 当用户首次启动您的应用程序时,请在后台下载实际的贴纸,并在成功下载后显示它们。 Add some logic to check whether any new stickers available to download when your app is launched each time and act accordingly. 添加一些逻辑以检查每次启动应用程序时是否有任何新的贴纸可下载并采取相应的措施。

For iOS there are several methods to reduce the app size, please check this Technical Q & A 对于iOS,有几种方法可以减小应用大小,请查看此技术问答

Use Firebase Cloud Storage to upload your stickers as images. 使用Firebase Cloud Storage将贴纸作为图像上传。 You can download those images and display them in your app. 您可以下载这些图像并将其显示在您的应用中。 Go through the Firebase Cloud Storage Documentation for the details. 详细了解Firebase Cloud Storage文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM