How to enable the Portrait Effect in live camera view similar to SnapChat?

I have a camera view based on AVFoundation. Any idea how I can switch to Portrait Effect in iOS's Control Center like SnapChat?

Opting your app in to the Portrait effect is covered in this video, the link is timestamped to the relevant section: https://developer.apple.com/videos/play/wwdc2021/10047/?time=1324

In short, unless your iOS app is a VoIP app, you need to explicitly opt-in by adding the "NSCameraPortaitEffectEnabled" key to your info.plist with a value of "YES". This key also comes up as the "Camera — Opt in for Portrait Effect" key in Xcode.

I have a very interesting issue. I used this on a dummy application and I am able to make this portrait effect. The magic happened is when I pasted the exact code into the company application with all the properties like "Camera — Opt in for Portrait Effect", "Camera — Opt in for Reaction Effects" to YES but it is not working there.

In the above video by apple it clearly states that frame rate should be below 30fps as well as max resolution 1920 X 1440. I did made this all but still it isn't showing up on the company app. I even tried to see if the effect is support or not print("supports portraits : \(videoDevice.activeFormat.isPortraitEffectSupported)") and this prints out true.

Even tried AVCaptureDevice.showSystemUserInterface(.videoEffects) to see what is happening and it shows without portraits effects even when it is toggled on.

How to enable the Portrait Effect in live camera view similar to SnapChat?
 
 
Q