iKenndac / Tofu

An easy-to-use two-factor authentication app for iOS
https://tofuauth.com
ISC License
490 stars 64 forks source link

Allow picking icons from the photo library #23

Open ThinkChaos opened 4 years ago

ThinkChaos commented 4 years ago

I think it would be nice to avoid bundling icons in Tofu but instead fetch the icons from the websites.

Most websites have a <link rel="icon" href="favicon.ico"> element, or even better icons for smartphones such as <link rel="apple-touch-icon-precomposed" sizes="114x114" href="...">.

What do you think of having a map of issuer to domain, and then automatically fetching the appropriate icon? This would also make it easy to allow users to have icons for unsupported providers by adding an "icon domain" field to the edit page.

I could try to implement this if you think it's viable and interesting 😃

If I do implement this, would you be willing to accept a PR that uses an API to extract the icons such as realfavicongenerator.net?

calleluks commented 4 years ago

Hey there @ThinkChaos, thanks for the feedback!

Due to potential security and privacy issues, I'm hesitant to add networking code to the app. I definitely want to make it easier to add new issuer icons, though!

My current idea for how to do this is to commit square full size icons to this repo and include a script that can generate icons of different sizes with rounded corners that can then be used in Xcode when building the app.

Perhaps there could also be another script that would download icons given a list of domain names?

ThinkChaos commented 4 years ago

I understand why you'd rather not have any networking in the app. I had another idea today: allow users to paste an image as the icon. Doing so they could find the icon through whatever means and add them easily in Tofu without recompiling.

What do you think of this approach?

calleluks commented 4 years ago

I think that could work well. Maybe we could use the built in UIImagePickerController?

2br-2b commented 3 years ago

Maybe the app:

  1. Sees if it has the app icon stored in its database
  2. If it doesn't, it prompts the user as to whether they want to fetch the icon from online
  3. If the user says no, it uses the default icon