OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
104 stars 50 forks source link

how to set small_icon? #198

Closed ivandharo closed 4 years ago

ivandharo commented 4 years ago

Description: Hello im trying to use a resource image in my project but i can't make it work.

Here is my code. Im new with this plugin, btw awesome work.

        // Just an example userId, use your own or get it the devices by calling OneSignal.GetIdsAvailable
        string userId = "someone id";

        var notification = new Dictionary<string, object>();
        //id que proporciona OneSingal en Key & ID's
        notification["app_id"] = "app id";
        //Titulo
        notification["headings"] = new Dictionary<string, string>() { { "en", "Titulo" } };
        //mensaje
        notification["contents"] = new Dictionary<string, string>() { { "en", "mensaje" } };
        //icono de la notificacion para ANDROID
        notification["small_icon"] = Application.Current.Resources["dotSettings.png"];<------ Here

i read the documentation and it receive a string. image

Environment

  1. What version of the Xamarin SDK are you using? 4.6.0.800
  2. How did you add the SDK to your project (eg. nuget) Nuget