-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
How do I apply a smallIcon? #1627
Comments
We create a res folder at the root level for the application. e.g. where the config.xml file sits. Inside the res folder we have folders for android and subfolders for that with the different icons in
We have a hook
to look for the various png files in the res folder and copy them to
here's the code
This is for PushWoosh notifications, hence the pw_ prefix. YMMV. |
Pretty much the same as @rwillett I do: "res://actionbar_light" and actionbar_light is a properly constructed action bar icon at each resolution (google specs this pretty tightly, if you don't follow their spec it will just show the default bell icon) Because the cordova copying process is arcane to me, I also copy the individual icons to the platforms/android/res/drawable-xhdpi folder (etc., one folder for each resolution). Then res:// can find them. I stress: the icon absolutely has to conform to the google spec or you'll get the bell |
@Tawpie seconded. |
hello @rwillett So inside platforms/android/ The shell-script is an automation therefore to add the relevant assets out of the provided res/android/ folder to the corresponding res/ folder (in platforms/android/). Well I first skipped the automation part and created the folders and icons manually to just see if I get where I want to. The problem I'm facing then is that as soon I have a res/ folder in the platforms/android/ directory android won't build nor run. I use the latest phonegap cli 8.0.0 using cordova Android 7.0.0. So I'm investigating now on the build process itself. Using android Studio. Another question which came to my mind then was - as this looks like quite android specific, how will that work for iOS? Also, is there a real difference between folders called mipmap-ldpi to drawable-ldpi? @Tawpie |
Yet I have found the folder on my system where to I have put the ressources in: When I include the icons notification.png of size It finally builds and works yey! :D Now I can automate that with such a hook-script as inspired by @rwillett thnx! And hope that for iOS it just works^^ |
@JhonnyJason Congratulations! Remember iOS doesn't need a small icon, it just uses the app icon. Also remember that every time you remove/add the android platform it will remove your new res folder so you have to put everything back. I'd recommend making a copy of the platforms/android/res folder once you get everything working and then copying that copy back when needed. I don't know for sure what the mipmap folders are supposed to hold, for my app I have the app icon and splash screen in the xhdpi/ldpi etc. folders. The last piece of icon heck to overcome is the Android26 app icon—I have two xml files in platforms/android/res/mipmap-anydpi-v26 in the res folder, again manually (actually with a script) placed. |
Thanx, I guess I should take care about the v26 case too - will close as soon as I have everything set up and working like a charm ;-) |
Thats why the hook script is there, to regenerate as needed. @Tawpie copies the directory tree, I recreate the directory tree, the time taken to do this is effectively zero. You have the script, you know the technique. This should be easy now. Rob |
Hello, You're right for the local build :D where we have full control over hooks. When trying to use Phonegap Cloud build service for iOS and Android the quest on how to get the Icons right and everything neat appears to be not satisfactory solvable. So I have to detach from that Quest - here is the current state: And will close the issue - dealing with other issues :-) Thanx and Cheers! |
Thank you @JhonnyJason for your answer. This really help me! All my day i try to set smallIcon on android and finally i did this! I'm using this plugin with Meteor! What is important in my case that:
|
Hello,
I'm quite clueless how I do include a smallIcon.
I have been prompted that I need to use a "res://..." path.
But it appears that I have no Idea around that. And just stubbornly use
smallIcon: "res://path/to/icon/in/www
or
smallIcon: "res://path/to/icon/in/www/without/www
Does not do the trick. And I assume that naive attempt is pretty newbish because I'm missing out on what "res://" actually means.
So I'm there on the journey what this res:// actually is and how I can but ressources in there through cordova.
Maybe somebody here knows how I should treat it?
I'm already researching about it - until yet it only confused me, appears I need to completely figure out how Cordova moves assets for iOS and Android during build which is quite a task :-/
The text was updated successfully, but these errors were encountered: