Skip to content

Commit

Permalink
Added support for insistent notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
DelphiWorlds committed Jul 6, 2024
1 parent 131e053 commit feebd01
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Java/Base/DWMultiBroadcastReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,18 @@ public void onReceive(Context context, Intent intent) {
notificationIntent.putExtra("title", getNotificationTitle(notification));
notificationIntent.putExtra("body", getNotificationText(notification));
notificationIntent.putExtra("notifyId", intent.getIntExtra(EXTRA_NOTIFICATION_ID, 0));
if (intent.hasExtra("isInsistent"))
notificationIntent.putExtra("isInsistent", intent.getStringExtra("isInsistent"));
if (intent.hasExtra(EXTRA_NOTIFICATION_IMAGE)) {
String imagePath = intent.getStringExtra(EXTRA_NOTIFICATION_IMAGE);
Log.d(TAG, "imagePath: " + imagePath);
File file = new File(imagePath);
try {
notificationIntent.putExtra("imageUrl", file.toURI().toURL().toString());
} catch (MalformedURLException e) {
Log.e(TAG, "Image path invalid: " + imagePath);
if (imagePath != null && !imagePath.isEmpty()) {
Log.d(TAG, "imagePath: " + imagePath);
File file = new File(imagePath);
try {
notificationIntent.putExtra("imageUrl", file.toURI().toURL().toString());
} catch (MalformedURLException e) {
Log.e(TAG, "Image path invalid: " + imagePath);
}
}
}
DWNotificationPresenter.presentNotification(context, notificationIntent, notification.getChannelId(), notification.getSmallIcon().getResId());
Expand Down

0 comments on commit feebd01

Please sign in to comment.