WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

App Size Reduction: Country flag icons

Open mindgraffiti opened this issue 5 years ago • 2 comments

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.xcassets folder 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"
      }
   }
}

mindgraffiti avatar Nov 05 '20 21:11 mindgraffiti

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, or good 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.

stale[bot] avatar Apr 29 '22 13:04 stale[bot]

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.

guarani avatar Feb 23 '24 18:02 guarani