Skip to content

Commit

Permalink
Fix: Add missing icon to notification (close doublesymmetry#2049)
Browse files Browse the repository at this point in the history
Using `ExoPlayerR.drawable.exo_notification_small_icon` which is exoplayer’s default notification icon.
  • Loading branch information
puckey committed Jun 29, 2023
1 parent 04e42e9 commit 6830d98
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import com.doublesymmetry.trackplayer.utils.BundleUtils.setRating
import com.facebook.react.HeadlessJsTaskService
import com.facebook.react.bridge.Arguments
import com.facebook.react.jstasks.HeadlessJsTaskConfig
import com.google.android.exoplayer2.ui.R as ExoPlayerR
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.flow
import java.util.concurrent.TimeUnit
Expand Down Expand Up @@ -114,6 +115,7 @@ class MusicService : HeadlessJsTaskService() {
val notificationBuilder = NotificationCompat.Builder(this, name)
.setPriority(PRIORITY_LOW)
.setCategory(Notification.CATEGORY_SERVICE)
.setSmallIcon(ExoPlayerR.drawable.exo_notification_small_icon)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
notificationBuilder.setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE)
}
Expand Down

0 comments on commit 6830d98

Please sign in to comment.