Skip to content

Commit

Permalink
Added check for range of importance.
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg committed Feb 26, 2018
1 parent b242560 commit c207831
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/backendless/push/PushTemplateHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ static Notification convertFromTemplate( Context context, AndroidPushTemplate te
notificationBuilder = new NotificationCompat.Builder( context.getApplicationContext() );
notificationBuilder.setDefaults( Notification.DEFAULT_ALL );

if (template.getPriority() != null)
notificationBuilder.setPriority( template.getPriority() );
if( template.getPriority() != null && template.getPriority() > 0 && template.getPriority() < 6 )
notificationBuilder.setPriority( template.getPriority() - 3 );
else
notificationBuilder.setPriority( Notification.PRIORITY_DEFAULT );

Expand Down Expand Up @@ -237,7 +237,7 @@ static private NotificationChannel updateNotificationChannel( Context context, N
{
notificationChannel.setShowBadge( template.getButtonTemplate().getShowBadge() );

if (template.getPriority() != null)
if( template.getPriority() != null && template.getPriority() > 0 && template.getPriority() < 6 )
notificationChannel.setImportance( template.getPriority() ); // NotificationManager.IMPORTANCE_DEFAULT

if( template.getButtonTemplate() != null && template.getButtonTemplate().getSound() != null )
Expand Down

0 comments on commit c207831

Please # to comment.