How to prevent Notifications pop-up

I have developed an application for macOS. When I install it and open it for the first time on Big Sur, it shows a pop-up:

app-name Notifications
Notifications may include alerts, sounds and icon badges

The user can close this pop-up or choose between Allow and Don't Allow.

This pop-up is very confusing for users as the application doesn't produce any notifications. This pop-up does not appear on Catalina. How can I stop it appearing on Big Sur? I have tried setting NSUserNotificationAlertStyle to none in Info.plist but this hasn't made any difference.

This pop-up will appear when an app requests authorization to send notifications. If you are not making this request in your app, it's possible that a third-party library you're using has implemented that request even though your app doesn't do anything with notifications.

The only way to eliminate the pop-up is to remove the code that calls requestAuthorization() from your app, whether yours or a third party's.

I discovered that the Java library contains code that uses the deprecated NSUserNotification API and calls NSUserNotificationCenter setDelegate. The delegate has a shouldPresentNotification method that always returns YES. I suspect this is what is triggering the pop-up even though the app doesn't send any notifications.

How to prevent Notifications pop-up
 
 
Q