App Size Reduction: Country flag icons
Ref. paNNhX-1H-p2
As part of our app size reduction efforts, create an API request to /sites/$site/stats/country-views/. Docs. The response body contains a key, country-info, which links to stylized flag icons and flat icons. The icons are PNG format. Pass the size parameter to scale the PNG.
- [ ] Add API request
- [ ] Extract image download URL
- [ ] Pass the image download URL to the ViewModels
- [ ] Download image
- [ ] Delete the
Flags.xcassetsfolder and files
Example response body
{
"date":"2020-11-05",
"days":{
"2020-11-05":{
"views":[
{
"country_code":"CN",
"views":1
}
],
"other_views":0,
"total_views":1
}
},
"country-info":{
"CN":{
"flag_icon":"https:\/\/secure.gravatar.com\/blavatar\/7b8f2d7453c642ac4c6920bd021bf881?s=48",
"flat_flag_icon":"https:\/\/secure.gravatar.com\/blavatar\/381326b114d5f7264d3207021c3d6437?s=48",
"country_full":"China",
"map_region":"030"
}
}
}
This issue has been marked as stale because:
- It has been inactive for the past year.
- It isn't in a project or a milestone.
- It hasn’t been labeled
[Pri] Blocker,[Pri] High, orgood first issue.
Please comment with an update if you believe this issue is still valid or if it can be closed. This issue will also be reviewed for validity and priority during regularly scheduled triage sessions.
Confirmed we still have the 2.1 MB Flags.xcassets and the /sites/{site_id}/stats/country-views endpoint works and returns URLs for the flags, so I think this is a good improvement.