Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon and Splashscreen assets? #229

Closed
janpio opened this issue Mar 1, 2018 · 34 comments
Closed

Icon and Splashscreen assets? #229

janpio opened this issue Mar 1, 2018 · 34 comments

Comments

@janpio
Copy link
Contributor

janpio commented Mar 1, 2018

In Ionic with Cordova this is all done (more or less) automatically by using ionic cordova resources and then Cordova copies all the images to the right places and does the configuration.

How does it work in Capacitor?

@jcesarmobile
Copy link
Member

For now it's manual, you add the images as you'll do it on a native project

@janpio janpio changed the title Docs: Icon and Splashscreen configuration Icon and Splashscreen configuration? Mar 1, 2018
@janpio
Copy link
Contributor Author

janpio commented Mar 1, 2018

Capacitor could use a docs article with a description of that process and/or links to description on guides on that.

And of course some help and automation in resizing and placing the pictures would be nice as well.

@mlynch
Copy link
Contributor

mlynch commented Mar 4, 2018

Yep definitely want to get Ionic's resources working for capacitor as well

@janpio janpio changed the title Icon and Splashscreen configuration? Icon and Splashscreen assets? Mar 7, 2018
@janpio
Copy link
Contributor Author

janpio commented Mar 8, 2018

Are you planning to implement this in the Ionic CLI when a capacitor integrations exists there or should this somehow be more independent from the Ionic CLI and covered over here?

There are npm packages that can resize icons locally, then it would "only" missing to copy the files and modify the native project files.

@sandstrom
Copy link
Contributor

This package is great for building iOS/Android assets from an SVG source:
https://github.com/isleofcode/splicon

Although it's currently used for Corber (build-tooling for Cordova) it is an isolated npm package (it only does resizing) that could easily be adapted to work well with capacitor.

Also, not reinventing the wheel and sharing the code with other projects makes a lot of sense.

@sneko
Copy link

sneko commented Oct 23, 2018

@jcesarmobile I know there is no built-in generator in Capacitor, but did you organized all the icons and splashcreens tree manually for iOS and Android? Or did you use a generator?

@jcesarmobile
Copy link
Member

Android Studio has a generator for the icons, for splash you have to manually put them in res folder. For iOS there is an asset catalog where you drag the icons and splash and Xcode put them in the right place and rename

@stewones
Copy link
Contributor

stewones commented Jan 8, 2019

hello @mlynch, first of all thank you for all your efforts on making our next "cordova". Do you have any idea about when we'll able to use ionic resources for capacitor?

@Freelane
Copy link

Freelane commented Jan 9, 2019

+1, looking for guidance in that respect as well

@imhoffd
Copy link
Contributor

imhoffd commented Apr 22, 2019

Capacitor can use cordova-res for this: https://github.com/ionic-team/cordova-res

@joseadame
Copy link

It would be useful. Please add it.

@scottieslg
Copy link

+1 to add this

@lindsey-tonn
Copy link

+1

@SansaoVinicius
Copy link

It would be useful. Please add it. +1

@leandrorebelo
Copy link

leandrorebelo commented Sep 6, 2019

I have the same problem. I saw that the priority is low 🤕

@dalezak
Copy link

dalezak commented Oct 3, 2019

It's still a work in progress, but here's a semi-automated way to generate icon and splash resources for Capacitor. https://gist.github.com/dalezak/a6b1de39091f4ace220695d72717ac71

It will use cordova-res to generate all the various image sizes, then runs the script to copy over the generated images to the iOS and Android projects.

  1. Run npm install cordova-res --save-dev
  2. Create 1024x1024px icon at resources/icon.png
  3. Create 2732x2732px splash at resources/splash.png
  4. Add "resources": "cordova-res ios && cordova-res android && node scripts/resources.js" to scripts in package.json
  5. Copy resources.js file to scripts/resources.js
  6. Run sudo chmod -R 777 scripts/resources.js
  7. Run npm run resources

@alejandrovisciglio
Copy link

@dalezak Awesome, thanks a lot!!

@brospars
Copy link

brospars commented Oct 8, 2019

Thanks ! Something like this should be added to capacitor sync android

@3alampro
Copy link

+1 for this request we really need splash screen and app icon generation automated on capacitor by default

@sandstrom
Copy link
Contributor

There are a few different projects for generating these resources.

I've tried to encourage them to collaborate:
ionic-team/capacitor-assets#51

If anyone is interested, there are a list of similar projects in that issue.

@imhoffd
Copy link
Contributor

imhoffd commented Nov 26, 2019

@dalezak It looks like resources.js is what copies the generated resources into the native Capacitor projects. I'd be more than happy to look at a PR that adds that functionality to cordova-res. 😄

@mckelveygreg
Copy link

@dalezak Thank you so much!! I'm so happy I found this!

@imhoffd
Copy link
Contributor

imhoffd commented Mar 24, 2020

Hello 👋

cordova-res now has this functionality thanks to a PR by @wannadream 👏

To give it a try:

npm install -g cordova-res

Then run the following in your project:

cordova-res --skip-config --copy

See the README for more details: https://github.com/ionic-team/cordova-res#capacitor

Let me know what you think! Thanks!

@sandstrom
Copy link
Contributor

Great! Support for automatically copying icons and spash screens into a Capacitor project is very useful. Thanks @wannadream!

@EdvardGilz
Copy link

EdvardGilz commented Apr 6, 2020

Hello, I've found an NPM library focused on Capacitor proyects, it works like ionic cordova resources

https://www.npmjs.com/package/capacitor-resources

@sebinbenjamin
Copy link

@IT-MikeS
Copy link
Contributor

IT-MikeS commented Jun 23, 2020

I believe this will be covered in the upcoming docs update but in the meantime please reference this section of cordova-res

https://github.com/ionic-team/cordova-res#capacitor

@dwieeb would this be better suited as a discussion now?

@imhoffd
Copy link
Contributor

imhoffd commented Jun 23, 2020

There are still a few things missing with cordova-res and Capacitor, unfortunately. They should work in 1.0.0. Track this milestone for progress: https://github.com/ionic-team/cordova-res/milestone/1

@danielehrhardt
Copy link

danielehrhardt commented Jun 25, 2020

Hope they will release soon. Meantime you could use https://www.npmjs.com/package/capacitor-resources

@neoacevedo
Copy link

It's ok, it generate each png file for the splash but... about the SVG images, isn't yet?

@mlynch
Copy link
Contributor

mlynch commented Nov 10, 2021

Going to be tackling some of this in the first release of @capacitor/assets which is going to be the next generation of the old cordova-res project. Track progress here: https://github.com/ionic-team/capacitor-assets

@sandstrom
Copy link
Contributor

@mlynch Suggestion: try to use an SVG as the source image (optionally several, in case you want less detail in the smaller icons).

#229 (comment)

@jcesarmobile
Copy link
Member

closing closing as @capacitor/assets is available now.

@jcesarmobile jcesarmobile closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Dec 1, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests