Commit abbe3c3a authored by Sebastián Katzer's avatar Sebastián Katzer
Browse files

All notifications under Android display the app icon by default.

parent 68381d41
Loading
Loading
Loading
Loading
+12 −1
Changes for src/android/LocalNotificationOptions.java: 12 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ package de.appplant.cordova.plugin.localnotification;
import java.util.Calendar;
import java.util.Date;

import org.apache.cordova.CordovaInterface;
import org.json.JSONObject;

import android.R;
@@ -100,7 +101,17 @@ public class LocalNotificationOptions {
     * Gibt den Pfad zum Icon der Notification an.
     */
    public int getIcon () {
        return options.optInt("icon", R.drawable.ic_menu_info_details);
        int icon                 = R.drawable.ic_menu_info_details;
        CordovaInterface cordova = LocalNotification.cordova;
        String packageName       = cordova.getActivity().getPackageName();

        try {
            Class<?> klass = Class.forName(packageName + ".R$drawable");

            icon = (Integer) klass.getDeclaredField("icon").get(Integer.class);
        } catch (Exception e) {}

        return options.optInt("icon", icon);
    }

    /**