How to add icon to push notification using firebase-nativescript - firebase

I am trying to add white icon with transparent background for my push natifications using nativescript with firebase and angular. I have generated icons using https://romannurik.github.io/AndroidAssetStudio/icons-notification.html#source.type=clipart&source.clipart=ac_unit&source.space.trim=1&source.space.pad=0&name=ic_stat_ac_unit
but no matter what i do i get just white square
So far i have tried:
adding default icon to manifest
meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/notification_icon" />
passing icon via message it self
"icon": "ic_stat_ac_unit",
If nothing above added nativescript icon in notifications shows fine.
Another related question would be how to add image on the left hand side of notfication like instagram and other are doing
enter image description here

It started to work after i removed android folder undel platforms and rebuild whole solution

Related

Unable to add an image in the storyboard editor in Visual Studio to create a splash screen for Xamarin.iOS

I'm trying to add a splash screen to an iOS app built using Xamarin.Forms. I'm able to get the splash screen itself to display, but I'm unable to add an image to an ImageView in the storyboard editor.
I can replicate this behavior in a brand-new "Cross Platform" solution, and I'm following the instructions here. Specifically, at step 10 in the instructions, you're supposed to be able to select the image from a dropdown.
If you actually click on the arrow of what only appears to be a dropdown, however, nothing actually "drops down"; instead VS opens an OpenFileDialog entitled "Add Existing Item".
No matter what file I choose, VS only adds it to the project's Resource folder (as a BundleResource), but doesn't change the image in the storyboard at all.
I've tried adding the images to the Asset Catalog as both a Launch Image and a regular Image Set. I've tried typing either a filename or an asset set name into the editable part of the "dropdown"; no luck. I've also tried editing the storyboard XML to add an image= attribute (to the ImageView tag), again using either a filename or an asset set name, but it doesn't work, and subsequent saves from the storyboard editor actually remove the attribute. I also tried explicitly adding the entire "Assets.xcassets" folder to the project, as suggested by one of the answers here.
FWIW, the property labeled "Highlighted", directly under "Image", also has the same behavior. I'm assuming this is a VS bug of some sort; the behavior of the property is different not only from what's described in the docs, but conflicts with the appearance of the control.
Has anyone come across a workaround?
Windows 10 Pro
VS 2017 15.8.3
Xamarin 4.11.0.756
Xamarin Designer 4.14.221
Xamarin.iOS and Xamarin.Mac SDK 11.14.0.13
It is bug, you can voite to this problem https://developercommunity.visualstudio.com/content/problem/319294/xamarinios-cant-select-image-asset-for-image-view.html

How to Change the Android Notification Icon/Status Bar Icon for Push-notification in #flutter?

I want to replace the default Icon with my own icon for Push-notifications.
Now the App show the Icon as White box .
Ajay's answer is correct, but to expand on it a bit:
NOTE: Before starting, make sure your icon/image has a transparent background. The solution will seem like it's not working if your image background has a color.
Create your mipmap notification icon. You can do this easily using Roman's Notification Icon Generator - Click on "Notification Icon Generator"
On the left panel, click "Image" to upload your own image or use ClipArt or text as provided.
After you're done, click the download button in the upper-right to download the zip file. Alternative to Roman's Notification Icon Generator, try appicon.co
In the zip file, your icon files will be in individual directories with the same name as your mipmap directories in your project directory (e.g., "mipmap-hdpi", "mipmap-mdpi", etc.). Move the icon files to their respective folders within your project.
In your AndroidManifest.xml file (located at android/app/src/main/AndroidManifest.xml), add the meta-data within the "application" tag:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.your.package">
<application
android:name="com.your.package.Application"
android:label="YourAppName"
android:icon="#mipmap/launcher_icon">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#mipmap/your_icon_file_name" />
Save your file. You may need to stop and restart or uninstall and reinstall your app for the notification icon to start showing.
Your icon is probably white, so if you want to change the color you can add the following meta-data tag below the icon meta-data tag you just added:
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="#android:color/black" />
That will change the icon to black, but you can set your own colors in res/values as stated here: Android System Color Constants
Information about the meta-data tags is here: https://firebase.google.com/docs/cloud-messaging/android/receive
Just add a meta-data inside tag in your manifest file.
Reference
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="When Coin"
android:icon="#mipmap/ic_launcher">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#mipmap/ic_stat_ic_notification" />
NOTE: Before starting, make sure your icon/image has a transparent background. The solution will seem like it's not working if your image background has a color.
Want to generate mipmap icons, try appicon.co/

Distriqt push notification icon at status bar remain white at Android 5

Andorid 5 take 96px icon as default for status bar and until it is not white + aplha changel it wont display it. But 96px icon is also used for main application icon.
How can I set this status bar icon to custom one?
how it look like
With Android 5+ you need to provide dedicated notification icons which are white/grey and transparent to fit in with the Android design guidelines. Currently there is no way to include these icons through the AIR application descriptor. Instead you have to add them as custom Android resources.
To do this you'll need to create an icon that is only white with transparency something like the below:
Then goto the Android Asset Studio Notification Icon Generator
https://romannurik.github.io/AndroidAssetStudio/icons-notification.html
and upload your source image. Make sure you change the name of the icon. Take note of this name as you will be using this name to reference this icon in notifications. In the example below we used your_icon_name.
You can then download the zip and extract the contents and you should have a series of directories containing all the different sized icons required.
Next, download our CustomResources ANE generator script from the following repository:
https://github.com/distriqt/ANE-CustomResources
Follow the instructions to setup the script and then copy the contents of the zip you downloaded earlier into the res directory in the script root.
After running the script you should have an ANE com.distriqt.CustomResources.ane that you can include in your project.
Now you can use the name of your icon to create notifications:
Notifications.service.notify(
new NotificationBuilder()
.setIcon( "your_icon_name" )
.setAlert( "Notification Alert" )
.setTitle( "Notification Title" )
.setBody( "The body of the notification" )
.build()
);

Set icon for Notification in watchOS2

I'm working on notification in watchOS 2. I want to change icon of notification. I've set AppIcon in ImageAsset file but this didn't worked.
How can this be achieved?
Select the Assets.xcassets under your watchApp folder and create a new image set for watchOS App Icon , it will give your all the sizes for icons. Put all the icons over there. Make sure that watch icons don't contain alpha channel.

iCon file is missing when upload to App Store

When i upload my iPad app for iOS7 to app store , i got following message.
And here is my plist file.
I don't know where am i wrong?
Under App icons category under general section , select correct image like this. see screen shot.
Change your way to add icons on your project. You can refer here.
But, in your case, you have a problem with the name.
Your icon is named iCons and the #2x named iCon#2x without S and verify if you have all your icons file in your resources.
Here the guidelines iOS for all icons and the new guidelines for iOS 7 here.
and Here a website to create all size of your icons for iOS 6, 7 and Android with the 1024*1024.
Add the different keys of your icon in your info.plist and add the icons in your resources :

Resources