0

I'm working on a Xamarin application in which I'm trying to set a custom Notification but I have not result using Xamarin.Firebase.Messaging 119.0.1

NotificationCompat.Builder builder = new NotificationCompat.Builder(AndroidApp.Context, channelId)
    .SetContentIntent(pendingIntent)
    .SetContentTitle(pTitle)
    .SetContentText(pBody)
    .SetAutoCancel(true)
    .SetLargeIcon(BitmapFactory.DecodeResource(AndroidApp.Context.Resources, Resource.Drawable.abc_btn_check_material))
    .SetSmallIcon(Resource.Drawable.icon_test.png)
    .SetDefaults((int)NotificationDefaults.Sound | (int)NotificationDefaults.Vibrate);

I have been trying to reference name image , but this not recognize the image that I want to set in method SetSmallIcon...

Is there a way to reference the image that I want?

enter image description here

Thanks!!

1
  • Can you try Resource.Drawable.Icon_Test
    – FreakyAli
    Commented Oct 18, 2024 at 7:15

1 Answer 1

0

(SOLUTION) I had to clean the solution, restart visual studio, rebuild the project. and then, finally, my drawable was found. Check in properties , specific "Build Action" says AndroidResource :)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.