Skip to content

Commit

Permalink
fix: updated IsolateHolderService to have IMMUTABLE flag as well for …
Browse files Browse the repository at this point in the history
…PendingIntent
  • Loading branch information
dmacan23 committed Jun 2, 2022
1 parent ff20b34 commit ee51b2e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class IsolateHolderService : MethodChannel.MethodCallHandler, LocationUpdateList
?: if (context != null) {
backgroundEngine = FlutterEngine(context)
backgroundEngine?.dartExecutor?.binaryMessenger
}else{
} else {
messenger
}
}
Expand Down Expand Up @@ -113,9 +113,15 @@ class IsolateHolderService : MethodChannel.MethodCallHandler, LocationUpdateList
val intent = Intent(this, getMainActivityClass(this))
intent.action = Keys.NOTIFICATION_ACTION

val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT
} else {
PendingIntent.FLAG_UPDATE_CURRENT
}

val pendingIntent: PendingIntent = PendingIntent.getActivity(
this,
1, intent, PendingIntent.FLAG_UPDATE_CURRENT
1, intent, flags
)

return NotificationCompat.Builder(this, Keys.CHANNEL_ID)
Expand Down

0 comments on commit ee51b2e

Please sign in to comment.