iOS. Push notification from any app cause ue4 game freeze

iOS. Push notification from any app cause ue4 game freeze

How to reproduce:

  1. Build and run any UE4 (4.22 or 4.23) project on iOS 13
  2. Receive a notification during the game. Render thread will freeze

What will happen:

Receive a notification during the game developed on UE4. Render thread will freeze for a couple of seconds but the audio thread will work fine.

This leads to an out of sync image and sound, which is very bad for music games and critical for shooters!

Workaround:

Muted device doesn’t freeze by notifications (watch the video below)

This is a critical problem for us and our team began to search where else you can find the same bug.

And we found …

This is reproducible in any (??) UE4 project running at least on iOS 13. For example:

Appstore: FORTNITE, Oceanhorn 2, Action RPG, UnrealMatch3

Marketplace (after build): Action RPG, UnrealMatch3, FaceAR Sample

We recorded a video with UE4 games on two different devices running on iOS 13. [UE4 Development] Push notification from any app cause UE4 game freezing on iOS 13 - YouTube

Look at screenshot from UE4 profiler from iOS device. Each peak on the chart is the moment when a notification was displayed.

How can we fix this?

Hello,

We’ve recently made a switch to a new bug reporting method using a more structured form. Please visit the link below for more details and report the issue using the new Bug Submission Form. Feel free to continue to use this thread for community discussion around the issue.

https://epicsupport.force.com/unrealengine/s/

Thanks

For those who are still facing the problem.
On devices with iOS 16 the problem disappears!

If you still have it:

  • Go to Engine/Source/Runtime/ApplicationCore/Private/IOS/IOSAppDelegate.cpp
  • Find -(void)MainAppThread:(NSDictionary*)launchOptions
  • Change bool bOtherAudioPlayingNow = [self IsBackgroundAudioPlaying];
  • to bool bOtherAudioPlayingNow = false;
  • Rebuild engine

You can make a “patch” and simply transfer the modified binaries to your engine from the launcher.

  • Build the game with the engine fix in all the schemes you need (Development \ shipping)
  • In the folder Intermediate / Build / IOS / ProjectName / Development
    there will be engine binaries for the Dev scheme.

AppDelegate is part of the ApplicationCore module.

  • Copy 3 files (cpp, cpp.d, cpp.o)
  • Go to the folder with your installed engine. Go to Engine / Intermediate / Build / IOS / Unreal Game /
  • And replace the module binaries for the scheme you need

Now you have a fixed engine module that will work in the engine installed from the store.

I often use this method so that I don’t have to mess with the engine from the source for small fixes :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.