Skip to content

Commit

Permalink
fix(android): prevent unnecessary channelId warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews authored and sgtcoolguy committed Mar 27, 2020
1 parent aab53e7 commit 1652d08
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ public NotificationProxy()
super();
notificationBuilder = new NotificationCompat.Builder(TiApplication.getInstance().getApplicationContext())
.setSmallIcon(android.R.drawable.stat_sys_warning)
.setWhen(System.currentTimeMillis())
.setChannelId(NotificationManagerModule.useDefaultChannel()
? NotificationManagerModule.DEFAULT_CHANNEL_ID
: "miscellaneous"); // NotificationChannel.DEFAULT_CHANNEL_ID
.setWhen(System.currentTimeMillis());

//set up default values
flags = Notification.FLAG_AUTO_CANCEL;
Expand Down Expand Up @@ -88,6 +85,10 @@ public void handleCreationDict(KrollDict d)
}
if (d.containsKey(TiC.PROPERTY_CHANNEL_ID)) {
setChannelId(d.getString(TiC.PROPERTY_CHANNEL_ID));
} else {
setChannelId(NotificationManagerModule.useDefaultChannel()
? NotificationManagerModule.DEFAULT_CHANNEL_ID
: "miscellaneous"); // NotificationChannel.DEFAULT_CHANNEL_ID
}
if (d.containsKey(TiC.PROPERTY_CONTENT_VIEW)) {
setContentView((RemoteViewsProxy) d.get(TiC.PROPERTY_CONTENT_VIEW));
Expand Down

0 comments on commit 1652d08

Please sign in to comment.