Skip to content

Commit

Permalink
1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
A.Badakhshan committed Jul 28, 2022
1 parent 26826c9 commit fc15f6c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion pushsdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ afterEvaluate {
maven(MavenPublication) {
groupId = 'com.github.shadowalker77'
artifactId = 'pushnotification'
version = '1.1.6'
version = '1.1.7'

from components.release
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,21 @@ public static void showNotificationMessage(final Context context,
+ "://" + context.getPackageName() + "/raw/notification");
// if (!TextUtils.isEmpty(bigIconUrl)) {
// if (bigIconUrl.length() > 4 && Patterns.WEB_URL.matcher(bigIconUrl).matches()) {
ImageHelper.downloadImage(bigIconUrl, new ImageHelper.OnBitmapDownloaded() {
@Override
public void onBitmapDownloaded(final Bitmap bigIcon) {
if (imageUrl != null) {
ImageHelper.downloadImage(imageUrl, new ImageHelper.OnBitmapDownloaded() {
@Override
public void onBitmapDownloaded(Bitmap bitmap) {
if (isCustom)
showCustomNotification(context, bitmap, mBuilder, icon, title, message, resultPendingIntent, alarmSound, buttonList, bigIcon);
else if (bitmap != null)
showBigNotification(context, bitmap, mBuilder, icon, title, message, resultPendingIntent, alarmSound, buttonList, bigIcon);
else
showSmallNotification(mBuilder, context, icon, title, message, resultPendingIntent, alarmSound, buttonList, bigIcon);
}
});
} else {
ImageHelper.downloadImage(bigIconUrl, bigIcon -> {
if (imageUrl != null) {
ImageHelper.downloadImage(imageUrl, bitmap -> {
if (isCustom)
showCustomNotification(context, null, mBuilder, icon, title, message, resultPendingIntent, alarmSound, buttonList, bigIcon);
showCustomNotification(context, bitmap, mBuilder, icon, title, message, resultPendingIntent, alarmSound, buttonList, bigIcon);
else if (bitmap != null)
showBigNotification(context, bitmap, mBuilder, icon, title, message, resultPendingIntent, alarmSound, buttonList, bigIcon);
else
showSmallNotification(mBuilder, context, icon, title, message, resultPendingIntent, alarmSound, buttonList, bigIcon);
}
});
} else {
if (isCustom)
showCustomNotification(context, null, mBuilder, icon, title, message, resultPendingIntent, alarmSound, buttonList, bigIcon);
else
showSmallNotification(mBuilder, context, icon, title, message, resultPendingIntent, alarmSound, buttonList, bigIcon);
}
});
// }
Expand Down Expand Up @@ -265,11 +259,16 @@ public static void playNotificationSound(Context context) {
}

private static PendingIntent getPendingIntentByMessage(Context context, Message message) {
int flags;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
flags = PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE;
else
flags = PendingIntent.FLAG_CANCEL_CURRENT;
return PendingIntent.getActivity(
context,
new Random().nextInt(1000),
IncomeMessageActivity.getIntentByMessage(context, message),
PendingIntent.FLAG_CANCEL_CURRENT
flags
);
}

Expand Down

0 comments on commit fc15f6c

Please sign in to comment.