Turning off Allow foreground activity will effectively reduce the power consumption of the app, but it may cause the app to not run normally. Besides, the corresponding notification may be delayed.
Setting method:
realme UI 3.0 & 2.0 & 1.0: Settings > Battery > Battery usage > Corresponding app > Allow foreground activity
realme UI 6.0 & 5.0 & 4.0: Not supported, but realme has optimized the app battery usage.
realme UI R & S & T & Go & U edition: Not supported