EddyVerbruggen / nativescript-local-notifications

:mailbox: NativeScript plugin to easily schedule local notifications
MIT License
162 stars 57 forks source link

Re: Runtime exception in android no valid small icon #162

Closed max-pro closed 5 years ago

max-pro commented 5 years ago

Getting exeception in firebase.

Here is Code i used to create local notification :

 LocalNotifications.schedule([{
             id: calendar[i].id,
            title: "Session Reminder",
            body: calendar[i].subject + " " + calendar[i].sessionName,
            bigTextStyle: true, // Adds an 'expansion arrow' to the notification (Android only)
            sound: "customsound",
            ticker: calendar[i].subject + " " + calendar[i].sessionName,
            at: new Date(calendar[i].date + "T" + calendar[i].startTime)
}]).then(function () {
            console.log("Notification Scheduled")
            console.log("Notification Scheduled" + calendar[i].id)
}, function (error) {
            console.log("Notification Not Scheduled" + error)
}) 

Error:

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.telerik.localnotifications.NotificationAlarmReceiver: java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=Notifications pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE)
       at android.app.ActivityThread.handleReceiver + 3389(ActivityThread.java:3389)
       at android.app.ActivityThread.access$1200 + 200(ActivityThread.java:200)
       at android.app.ActivityThread$H.handleMessage + 1662(ActivityThread.java:1662)
       at android.os.Handler.dispatchMessage + 106(Handler.java:106)
       at android.os.Looper.loop + 193(Looper.java:193)
       at android.app.ActivityThread.main + 6692(ActivityThread.java:6692)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 493(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main + 858(ZygoteInit.java:858)
EddyVerbruggen commented 5 years ago

Do you have this and this?

max-pro commented 5 years ago

Yes with a different name ic_launcher.

EddyVerbruggen commented 5 years ago

OK, if you want help please share a repo and ping me there with instructions.