Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit 51a6fc2

Browse files
lufinkeytanguyantoine
authored andcommitted
fix: controls not showing on Android lock screen (#227)
1 parent 6ee2a86 commit 51a6fc2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

android/src/main/java/com/tanguyantoine/react/MusicControlModule.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,13 @@ public void init() {
141141
createChannel(context);
142142
}
143143
nb = new NotificationCompat.Builder(context, CHANNEL_ID);
144+
nb.setVisibility(Notification.VISIBILITY_PUBLIC);
144145

145146
if (!(Build.MANUFACTURER.toLowerCase(Locale.getDefault()).contains("huawei") && Build.VERSION.SDK_INT < Build.VERSION_CODES.M)) {
146-
nb.setStyle(new MediaStyle().setMediaSession(session.getSessionToken()));
147+
MediaStyle style = new MediaStyle();
148+
style.setMediaSession(session.getSessionToken());
149+
style.setShowActionsInCompactView(new int[]{0,1,2});
150+
nb.setStyle(style);
147151
}
148152

149153
state = pb.build();

0 commit comments

Comments
 (0)