Fetch: setNotificationManager() in FetchConfiguration causes continuously play sound in Android 9.0 API 28 One Plus 6

Created on 9 Oct 2019  路  3Comments  路  Source: tonyofrancis/Fetch

I am setting notification manger to get download update in notification bar and its fine. But its continuously playing notification sound in device One Plus 6 which is run on Android 9.0 API 28.
My code for setting notification is:
FetchConfiguration fetchConfiguration = new FetchConfiguration.Builder(mContext) .setDownloadConcurrentLimit(50) .setAutoRetryMaxAttempts(1) .setHttpDownloader(new OkHttpDownloader(Downloader.FileDownloaderType.PARALLEL)) .setNotificationManager(new DefaultFetchNotificationManager(mContext) { @NotNull @Override public Fetch getFetchInstanceForNamespace(@NotNull String s) { return fetch; } }) .setNamespace(FETCH_NAMESPACE) .build();
I am doing nothing other things with notification!

help wanted

Most helpful comment

Thank god! For fixing this problem I was downloaded your library project and fixed it!! Sorry :) Now I will fix using new channel!

All 3 comments

I am setting notification manger to get download update in notification bar and its fine. But its continuously playing notification sound in device One Plus 6 which is run on Android 9.0 API 28.
My code for setting notification is:
FetchConfiguration fetchConfiguration = new FetchConfiguration.Builder(mContext) .setDownloadConcurrentLimit(50) .setAutoRetryMaxAttempts(1) .setHttpDownloader(new OkHttpDownloader(Downloader.FileDownloaderType.PARALLEL)) .setNotificationManager(new DefaultFetchNotificationManager(mContext) { @NotNull @Override public Fetch getFetchInstanceForNamespace(@NotNull String s) { return fetch; } }) .setNamespace(FETCH_NAMESPACE) .build();
I am doing nothing other things with notification!

Override the "channelId" with a custom one.
@NotNull @Override public String getChannelId(int notificationId, @NotNull Context context) { return CHANNEL_ID; }

Thank god! For fixing this problem I was downloaded your library project and fixed it!! Sorry :) Now I will fix using new channel!

You can override the createNotificationChannel and prevent it from vibrating or playing sounds by setting those values = false. You can also override updateNotification and .setOnlyAlertOnce(true) on the notification.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cepero91 picture cepero91  路  4Comments

maulik9898 picture maulik9898  路  4Comments

VitorAndrioli picture VitorAndrioli  路  4Comments

gbirk picture gbirk  路  6Comments

jpvs0101 picture jpvs0101  路  5Comments