From 72199a4f5a9a01cd61268a2d166f4f2ea67a8ccd Mon Sep 17 00:00:00 2001 From: Steve Hannah Date: Sat, 30 Sep 2023 07:21:37 -0700 Subject: [PATCH] Fix for local notifications not firing when app in background. --- Ports/iOSPort/nativeSources/CodenameOne_GLAppDelegate.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Ports/iOSPort/nativeSources/CodenameOne_GLAppDelegate.m b/Ports/iOSPort/nativeSources/CodenameOne_GLAppDelegate.m index 48b306b709..99b87135d6 100644 --- a/Ports/iOSPort/nativeSources/CodenameOne_GLAppDelegate.m +++ b/Ports/iOSPort/nativeSources/CodenameOne_GLAppDelegate.m @@ -439,9 +439,10 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNoti if( [response.notification.request.content.userInfo valueForKey:@"__ios_id__"] != NULL) { CN1Log(@"Received local notification while in background: %@", response.notification); - // Note: We currently don't do anything at this point. THe local notification callback - // will be triggered when the user clicks on the notification. + NSString* alertValue = [response.notification.request.content.userInfo valueForKey:@"__ios_id__"]; + com_codename1_impl_ios_IOSImplementation_localNotificationReceived___java_lang_String(CN1_THREAD_GET_STATE_PASS_ARG fromNSString(CN1_THREAD_GET_STATE_PASS_ARG alertValue)); completionHandler(); + return; } }