It may not be the foreground block itself causing the issue. I’d double-check when the service starts and whether it remains active when the app goes into the background. A few more screenshots of the related blocks could help the community identify the problem faster.
It seems that when I put the fourground block into screen1 block I had the block set player1.PlayOnlyInFourground = true
And when it's true means the app won't play in background at all! So I done a little research and changed it from true to false of course false means it will play in background thanks for any help though guys but it's fixed
Yes, and I don't understand since exactly when and why it is now set to "true" by default. That wasn't the case before, nor is it with Kodular or Niotron.
It used to be that PlayOnlyInForeground was set to False by default, but we changed the default to True. The reason being that on iOS, we need to add the additional background mode to Info.plist to support background audio. Our model for building up the manifest/plist is constructive, so the base case always needs to be the setting where nothing is needed. In this particular scenario, unchecking the "PlayOnlyInForeground" property (or setting it in the blocks) signals to the build system that background playback needs to be turned on for iOS. With the old default, we don't know whether the user just hasn't bothered changing the property or if the app actually needs the extra metadata. This ambiguity led to apps basically always having the background audio mode even when it wasn't needed, creating headaches for people submitting their apps to App Store Review.