AWSary / AWSary-iOS

AWS Dictionary iOS App
13 stars 2 forks source link

Implement App Clips #16

Closed tigpt closed 7 months ago

tigpt commented 2 years ago
tigpt commented 1 year ago

https://developer.apple.com/design/human-interface-guidelines/app-clips#App-Clip-Codes https://developer.apple.com/videos/all-videos/?q=app%20clips

tigpt commented 7 months ago

https://www.wwdcnotes.com/notes/wwdc23/10178/

New size limit

Starting with iOS 17, there is a new size limit for digital invocations of App Clips at 50 MB. If you'd like to make use of physical invocations, such as those through NFC tags or App Clip codes, you'll have to keep to the 15 MB limitation introduced in iOS 16. If you're targeting iOS 15 or earlier, the original 10 MB limitation still applies.

Basically for online links 50Mb but for NFC or app clip codes is 15Mb max

Only option to do this is remove the images from the app or reduce them enough. Look for ways to use SVG instead of JPG while it's difficult to render SVG on swiftUI at the moment, there are some approaches. alternatively, we could make all images behind cloudfront and load them on first app opening cashing them offline for future usage.

I would prefer to have SVG for now to reduce clients bandwidth as much as possible, since they are loading this from QR code or app clip code, possible on mobile data, less is faster and less impact on there data plans.

tigpt commented 7 months ago

Currently the app is 24Mb and the icons folder is 12Mb, so only possible to be in 15Mb limit if we can reduce the images from 12Mb to 3Mb.

Some margin for icons could be gain by trimming the app some more on other fronts and with little more optimisation.

Check if 3Mb is reasonable objective for SVG or if we need to look for other alternatives.

tigpt commented 7 months ago

AWS services icons: https://aws.amazon.com/architecture/icons/

find . -type f -name '*_64.svg' -exec cp {} ../SVG \;

Looks like all '_64.svg' files in architecture icons for 315 services are a total of 1.1Mb making this possible.

If we go a step further and compress the SVG with SVG compression technics we can get down to 661 KB. Saved 454 KB out of 1,1 MB. 42,3% per file on average (up to 71,5%)

Lets see if we can impor SVG and render them on the app instead of the images

tigpt commented 7 months ago

Convert PNG to SVG on https://github.com/AWSary/AWSary-iOS/pull/123

Now we can focus on app clips, can we ? identify new app size

tigpt commented 7 months ago

TestFlight new size is 6,6Mb 🤔 I was expecting less but not that much less, it can surprise us on App Store bigger then TestFlight.

I also bumped minimal OS, could be removing old swift binaries for compatibility.

tigpt commented 7 months ago

Use a different about screen without subscriptions or disclaimers and with a CTA, help this app by installing it and sharing with your friends and colleagues.

tigpt commented 7 months ago

App size down to 3Mb now. Promising

tigpt commented 7 months ago

First implementation done: 1d66a15e0fe88e966314d1b19cdeee4c448116cd there is space for improvement