Lock screen audio player notification not appearing when target SDK is 33

0 votes
defaultConfig {
    applicationId "com.aa.aaaa"
    minSdkVersion 19
    targetSdkVersion 33
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    multiDexEnabled true
}

When the target SDK is 33, I have a problem with player control notifications not working in lock screen , but when I set the target SDK to 31, the notifications work properly and appear on the lock screen.

I am using audio_service and just_audio for play audio in my application

Note:-

=> My lock screen notification option is on from my device setting.

=> i am facing this issue in samsung devices only in other device all thing is working well

=> i have samsung galaxy m32 and i have tried in other devices also and in all samsung device i am facing this issue

=> my flutter code is working good i personally think this issue is in plugin.

Apr 6, 2023 in Flutter by Ashwini
• 5,430 points
1,063 views

1 answer to this question.

0 votes

This issue may be related to the changes in Android 11 and later versions, where there are stricter requirements for notifications to appear on the lock screen. You may need to adjust your notification settings to comply with these requirements.

Here are some suggestions that might help:

  1. Request the necessary permissions: Make sure that your app has been granted the necessary permissions for displaying notifications on the lock screen. You can request these permissions by adding the following code to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY" />
  1. Use a MediaStyle notification: Use a MediaStyle notification instead of a NotificationCompat.Builder. This will give your notification the proper format and appearance for a media player.

  2. Set the notification priority to high: Make sure that the priority of your notification is set to high. This will ensure that your notification appears on the lock screen.

  3. Use a foreground service: Use a foreground service to ensure that your audio playback continues even when the app is in the background. This will also give your notification the necessary permissions to appear on the lock screen.

  4. Check the compatibility of the audio service and just_audio libraries: Make sure that the audio service and just_audio libraries are compatible with the target SDK version you are using. There may be some compatibility issues with newer versions of Android.

You may also want to check with the developers of the audio_service and just_audio libraries to see if they have any suggestions or updates that may address this issue.

answered Apr 6, 2023 by vishwa

Related Questions In Flutter

0 votes
1 answer

zegocloud's video/audio sdk flutter package error

It seems like there are some issues ...READ MORE

answered Apr 11, 2023 in Flutter by pooja
548 views
0 votes
1 answer

flutter, avatarGlow is not working at all with fluoatingbutton

Based on the code you provided, it ...READ MORE

answered Apr 14, 2023 in Flutter by Anitha
342 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,230 points
902 views
0 votes
1 answer

What is Flutter?

Hi@akhtar, Flutter is an app SDK for building ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,440 points
1,067 views
0 votes
1 answer
0 votes
1 answer

flutter app not running on ios simulator after adding firebase notification

The error message you provided seems to ...READ MORE

answered Apr 10, 2023 in Flutter by vishalini
4,465 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP