Native didReceiveNotificationResponse method not called when opening the app through push

Hi!

We are developing a multiplatform project, now working on the iOS platform implementation. We’re now adding support for push notifications, and building the app using the source code version of UE 5.5 in order to enable the native code that handles the notifications in the engine.

We’re sucessfully using the delegates

FCoreDelegates::ApplicationRegisteredForRemoteNotificationsDelegate

FCoreDelegates::ApplicationFailedToRegisterForRemoteNotificationsDelegate

FCoreDelegates::ApplicationReceivedRemoteNotificationDelegate

in order to retrieve the push token, listen for errors and receive the notifications , but we’ve found an issue.ReceivedRemoteNotificationDelegate is only triggered when the app is in foreground or background, but never when the app is not loaded into memory.

We’ve been investigating the engine source code and it seems, in the IOSAppDelegate.cpp file, the method

- (void)userNotificationCenter:(UNUserNotificationCenter *)center

willPresentNotification:(UNNotification *)notification

withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler

is never being called when we open the app through a push notification, even when the Notification center delegate is sucessfully registered in the didFinishLaunchingWithOptions method.

Is this a known issue? or there is something that needs to be setup in the project to make it work?

We’re building with Unreal 5.5.4 and Xcode 16.0

Thanks.

Hi Emilio,

Can you confirm the iOS version of the device this issue is occurring?

Best regards.

Hi Stéphane!

We are having this problem issue on iOS 18.5 (22f76)

Hi Emilio,

Can you confirm you have the ‘Background Modes’ -> ‘Remote notifications’ capability enabled (via bEnableRemoteNotificationsSupport)? Additionally, do the changes from 40900376 to IOSAppDelegate help.

Best regards.

Hi!

The background modes are set, but I cannot access the link provided, as I don’t have a salesforce account.

Regards.

Hi Emilio,

My apologies, had a bad URL for the CL. I’ve updated it in the original message.

Best regards.

Thanks Stéphane.

I’ll be OOO during next week. I’ll try the code after that.

Regards.

Thanks Emilio, we’ll await your update.

Best regards.

Hi Stéphane!

I came back yesterday and I got the news that we’ve to update to 5.6, and… I did it. Right now our code is on 5.6.0, but I’ll update to 5.6.1. I just noticed the hotfix today, but there is no clue about the issue I’m having being solved on the release notes.

Unfortunatelly, I’m still seeing the same behaviour when opening the app from a push notification. The apps opens, but we are not getting any callback from the push being processed.

I’ve been debugging, and I’ve found something interesting: The native ios methods are being called correctly when the app is being opened from the push notification, but the problem happens when the execution reachs the HandleReceivedNotification and does the following check before processing the notification

if ([IOSAppDelegate GetDelegate].bEngineInit)

If the app was not loaded in memory, the flag bEngineInit is not yet true when we reach this point. This flag is set on the

method.

-(void)MainAppThread:(NSDictionary*)launchOptions

So this seems to be a race condition, as the HandleReceivedNotification is being called before this flag is set**.** Is there any solution or setting to avoid to this?

Thanks.

Update: Today I build against 5.6.1 and the race condition is also happening.

Hi Emilio,

Thank you for the additional details, that was very helpful. We have provided a fix at CL 45025669/

Best regards.

Hi Stéphane.

Thanks for the heads up. I see this fix is merged in the main UE branch. It seems to be for 5.7. Any chance of this for an hipotetical 5.6.2 patch?

Regards,

Hi Emilio,

If there is a 5.6.2, it can be considered.

Best regards.