I’m trying to add the Status Bar Notification Plugin for Cordova to my Android App, but I get an error with it’s code.
Here’s the problematic code:
Notification noti = new Notification.Builder(context)
.setContentTitle(contentTitle)
.setContentText(contentText)
.setSmallIcon(icon)
.build();
The error is on the .build(), Eclipse tells me:
“The method build() is undefined for the type Notification.Builder”
I am having the same issue. It looks like a mismatch the sdk versions and now depreciated methods.
getNotification() is the method to call since API 11
build() was added in API 16
if you are like me, you are using a version < 16, so use .getNotification() instead.
Im not going to worry about API 16 right now but I bet if I download 16 and set my target to such, build() will work.
Let me know if it works for you.