rdelrosario / xamarin-plugins

Cross platform Xamarin & Windows plugins for PCLs
MIT License
179 stars 161 forks source link

Help configuring custom icon and sound on notification #129

Closed MartinGian closed 6 years ago

MartinGian commented 6 years ago

Hey,

I could configure everything fine the CrossPushNotification, even with the Application class to receive notifications when the app is closed.

I have a doubt respect configuring the icon and the sound of the notification, I read the README and it says to configure that in the

Android project using the following properties from CrossPushNotification class:

//The sets the key associated with the value will be used to show the title for the notification
public static string NotificationContentTitleKey { get; set; }

//The sets the key associated with the value will be used to show the text for the notification
public static string NotificationContentTextKey { get; set; }

//The sets the key associated with the root value will be used to show the text inside it for the notification
public static string NotificationContentDataKey { get; set; }

//The sets the resource id for the icon will be used for the notification
public static int IconResource { get; set; }

//The sets the sound  uri will be used for the notification
public static Android.Net.Uri SoundUri { get; set; }

I get confused about the place I have to configure that settings, is in the implementation of the IPushNotificationListener? I have to put some getters to that properties in that class?

Thanks, great lib, in a few steps I configured push notifications on my application.

rdelrosario commented 6 years ago

These are static properties on CrossPushNofication class, only available on your android project. So you will set it before or after intializing the plugin on your Android project.

CrossPushNotification.IconResource

CrossPushNotificatio.SoundUri

MartinGian commented 6 years ago

@rdelrosario I configured thatin the CrossPushNotification class in my Android prioject but the notification still with an empty icon

`
CrossPushNotification.Initialize("xxxxxxxx");

CrossPushNotification.IconResource = Resource.Drawable.icon;`

I fire the notifications on firebase console, am I missing something?

Thanks.