// [i18n:createChannel]
var channelId = "default_channel_id";
var notificationId = 1001;
var notifyMgr = context.getSystemService(Context.NOTIFICATION_SERVICE);
// [i18n:checkAndroidVersion]
if (Build.VERSION.SDK_INT >= 26) {
var importance = NotificationManager.IMPORTANCE_DEFAULT;
var channel = notifyMgr.getNotificationChannel(channelId);
if (channel == null) {
channel = new NotificationChannel(channelId, "[i18n:channelName]", importance);
notifyMgr.createNotificationChannel(channel);
}
var builder = new Packages.android.app.Notification$Builder(context, channelId);
} else {
var builder = new Packages.android.app.Notification$Builder(context);
}
// [i18n:buildNotification]
builder.setContentTitle("[i18n:notificationTitle]")
.setContentText("[i18n:notificationContent]")
.setSmallIcon(android.R.drawable.ic_dialog_info);
// [i18n:sendNotification]
var res = notifyMgr.notify(notificationId, builder.build());
res;