The problem is that the sound of notifications when the phone is locked is handled by the OS of the device, and when the screen is unlocked, and the app is in the foreground then the sound is handled by the app. This is why the users hear the sound notifications with different volumes.
So basically the user needs to handle the volume on iOS settings when the device is locked.