我是一些什麼意識到科爾多瓦,現在我在我的插件類中實現通知。原生通知android代碼在科爾多瓦插件java類
我已經使用了下面的android代碼在我的java類中創建通知。 我已經導入了與通知相關的所有軟件包。 但我得到通知異常,並無法得到通知
NotificationManager notificationManager = (NotificationManager)this.getSystemService(getApplicationContext().NOTIFICATION_SERVICE);
Notification notification=new Notification.Builder(getApplicationContext())
.setWhen(System.currentTimeMillis())
.setContentTitle("Welcome")
.setTicker("Click here to see the offers...")
.setContentText("Click here to see the offers...")
//.setSmallIcon(1)
.setAutoCancel(true)
.build();
notificationManager.notify(info, notification);
而且我得到的例外是
NotificationService(802): Not posting notification with icon==0: Notification(pri=0 icon=0 contentView=com.ionicframework.dummy292686/0x1090085 vibrate=null sound=null defaults=0x0 flags=0x10 when=1439564895752 ledARGB=0x0 contentIntent=N deleteIntent=N contentTitle=7 contentText=31 originalPackageName=N originalUserId=0 tickerText=31 kind=[null])
一些機構可以提出建議寫通知邏輯在科爾多瓦插件java類?
但它是java類,它是說:「在R.drawable.notification_icon找不到符號R上。 我沒有任何資源類在我的混合應用程序導入。 @Jim羅茲 –