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!
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.
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!