Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: iOS Maui App Crash on Adding PlugIn with Local.PushNotification PlugIn and Sending a Local.PushNotification #110

Closed
1 task done
SC-HeinrichG opened this issue Jun 11, 2024 · 4 comments

Comments

@SC-HeinrichG
Copy link

SC-HeinrichG commented Jun 11, 2024

What happened?

Without OneSignal installed in the App it works flawlessly with Local.PushNotification.
With OneSignal installed it Crash our App on sending a Local.PushNotification.
It looks like it want to process Local.PushNotification as one of it's own Message and can't then throw an Un-Handled System Exception.
This happens on iOS Maui.
Local.PhushNotification Nuget PlugIn

Steps to reproduce?

Create a .Net8.0 Maui App.
Add Local.PushNotifications plugIn and Integration.
Run the App and See Local.PushNotifications work as if Cloud Notifications.

Add OneSigal Notification.
Send a Local Push Notification and the App will Crash with the Logs provided.

What did you expect to happen?

Please don't Process the Message on OneSignal SDK side if the Message is not recognized.
Add exception handling as it throws an unhandled system exception.
Note:
I can't catch the exception on the App side.
All I can do is remove OneSiganl PlugIn from the App to make it not Crash the App.

Relevant log output

2024-06-11 13:47:46.184156+0200 SecureCitizenMAUI8[32580:503365] *** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException', reason: 'Failed to lookup the required marshalling information.
Additional information:
	Selector: onesignalUserNotificationCenter:willPresentNotification:withCompletionHandler:
	Type: Plugin_LocalNotification_Platforms_UserNotificationCenterDelegate
 (ObjCRuntime.RuntimeException)
Cannot get the method descriptor for the selector 'onesignalUserNotificationCenter:willPresentNotification:withCompletionHandler:' on the type 'Plugin.LocalNotification.Platforms.UserNotificationCenterDelegate', because the selector does not correspond to a method (ObjCRuntime.RuntimeException)
   at Registrar.DynamicRegistrar.GetMethodNoThrow(Type original_type, Type type, String selector, Boolean is_static) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/DynamicRegistrar.cs:line 907
   at Registrar.DynamicRegistrar.GetMethodNoThrow(Type original_type, Type type, String sele
ctor, Boolean is_static) in /Users/builder/azdo/_work/1/s/xamari
*** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException', reason: 'Failed to lookup the required marshalling information.
Additional information:
	Selector: onesignalUserNotificationCenter:willPresentNotification:withCompletionHandler:
	Type: Plugin_LocalNotification_Platforms_UserNotificationCenterDelegate
 (ObjCRuntime.RuntimeException)
Cannot get the method descriptor for the selector 'onesignalUserNotificationCenter:willPresentNotification:withCompletionHandler:' on the type 'Plugin.LocalNotification.Platforms.UserNotificationCenterDelegate', because the selector does not correspond to a method (ObjCRuntime.RuntimeException)
   at Registrar.DynamicRegistrar.GetMethodNoThrow(Type original_type, Type type, String selector, Boolean is_static) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/DynamicRegistrar.cs:line 907
   at Registrar.DynamicRegistrar.GetMethodNoThrow(Type original_type, Type type, String selector, Boolean is_static) in /Users/builder/azdo/_work/1/s/xamarin
-macios/src/ObjCRuntime/DynamicRegistrar.cs:line 902
   at Registrar.DynamicRegistrar.GetMethodNoThrow(Type original_type, Type type, String selector, Boolean is_static) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/DynamicRegistrar.cs:line 902
   at Registrar.DynamicRegistrar.GetMethodDescriptionAndObject(Type type, IntPtr selector, Boolean is_static, IntPtr obj, IntPtr& mthis, IntPtr desc) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/DynamicRegistrar.cs:line 858
   at ObjCRuntime.Runtime.GetMethodAndObjectForSelector(IntPtr klass, IntPtr sel, SByte is_static, IntPtr obj, IntPtr* mthisPtr, IntPtr desc) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 912
   at ObjCRuntime.Runtime.get_method_and_object_for_selector(IntPtr cls, IntPtr sel, SByte is_static, IntPtr obj, IntPtr* mthis, IntPtr desc, IntPtr* exception_gchandle) in /Users/builder/azdo/_work/1/s/xamarin-macios/runtime/Delegates.generated.cs:line 712
'
*** First throw call stack:
(
	0
   CoreFoundation                      0x0000000111f8c531 __exceptionPreprocess + 242
	1   libobjc.A.dylib                     0x0000000122cdb7e8 objc_exception_throw + 48
	2   libxamarin-dotnet-debug.dylib       0x000000010c58dfd6 xamarin_process_managed_exception + 934
	3   libxamarin-dotnet-debug.dylib       0x000000010c58db7b xamarin_process_managed_exception_gchandle + 59
	4   libxamarin-dotnet-debug.dylib       0x000000010c59acf3 xamarin_invoke_trampoline + 8547
	5   libxamarin-dotnet-debug.dylib       0x000000010c5a1d39 xamarin_arch_trampoline + 105
	6   libxamarin-dotnet-debug.dylib       0x000000010c5a2f1a xamarin_x86_64_common_trampoline + 118
	7   CoreFoundation                      0x0000000111f9315c __invoking___ + 140
	8   CoreFoundation                      0x0000000111f90483 -[NSInvocation invoke] + 302
	9   OneSignalCore                       0x000000010b3d68c6 +[SwizzlingForwarder callSelector:onObject:withArgs:] + 287
	10  OneSignalNotifications              0x000000010bc24bf6 +[OneSignalNo
tificationsUNUserNotificationCenter forwardNotificationWithCenter:notification:OneSignalCenter:completionHandler:] + 259
	11  OneSignalNotifications              0x000000010bc24f6b -[OneSignalNotificationsUNUserNotificationCenter onesignalUserNotificationCenter:willPresentNotification:withCompletionHandler:] + 740
	12  UIKitCore                           0x000000014d45a2b8 -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:completion:] + 2584
	13  UIKitCore                           0x000000014c53df98 -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 509
	14  UIKitCore                           0x000000014c53f043 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 252
	15  UIKitCore                           0x000000014cd38d76 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 466
	16  FrontBoardServices                  0x000000012f04fb99 -[FBSScene updater:didUpdateSettings:withDiff:transitionContext:completion:] + 8
50
	17  FrontBoardServices                  0x000000012f083aa4 __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke_2 + 149
	18  FrontBoardServices                  0x000000012f05da78 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 213
	19  FrontBoardServices                  0x000000012f0839dc __94-[FBSWorkspaceScenesClient _queue_updateScene:withSettings:diff:transitionContext:completion:]_block_invoke + 381
	20  libdispatch.dylib                   0x00000001246246d8 _dispatch_client_callout + 8
	21  libdispatch.dylib                   0x00000001246281e2 _dispatch_block_invoke_direct + 508
	22  FrontBoardServices                  0x000000012f0ad35f __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
	23  FrontBoardServices                  0x000000012f0ad239 -[FBSMainRunLoopSerialQueue _targetQueue_performNextIfPossible] + 188
	24  FrontBoardServices                  0x000000012f0ad387 -[FBSMainRunLoopSerialQueue _performNextFromRu
nLoopSource] + 19
	25  CoreFoundation                      0x0000000111ee8fb3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	26  CoreFoundation                      0x0000000111ee8ef5 __CFRunLoopDoSource0 + 157
	27  CoreFoundation                      0x0000000111ee86f2 __CFRunLoopDoSources0 + 215
	28  CoreFoundation                      0x0000000111ee2e27 __CFRunLoopRun + 919
	29  CoreFoundation                      0x0000000111ee26ad CFRunLoopRunSpecific + 557
	30  GraphicsServices                    0x000000012a5f508f GSEventRunModal + 137
	31  UIKitCore                           0x000000014d43fad1 -[UIApplication _run] + 972
	32  UIKitCore                           0x000000014d444551 UIApplicationMain + 123
	33  libxamarin-dotnet-debug.dylib       0x000000010c55d4ca xamarin_UIApplicationMain + 58
	34  libmonosgen-2.0.dylib               0x000000010cd8b345 do_icall + 341
	35  libmonosgen-2.0.dylib               0x000000010cd89ad7 do_icall_wrapper + 295
	36  libmonosgen-2.0.dylib          
     0x000000010cd7a7f6 mono_interp_exec_method + 3990
	37  libmonosgen-2.0.dylib               0x000000010cd77f63 interp_runtime_invoke + 259
	38  libmonosgen-2.0.dylib               0x000000010ce5e2d8 mono_runtime_invoke_checked + 136
	39  libmonosgen-2.0.dylib               0x000000010ce65c1b mono_runtime_exec_main_checked + 107
	40  libmonosgen-2.0.dylib               0x000000010ccca742 mono_jit_exec + 354
	41  libxamarin-dotnet-debug.dylib       0x000000010c5a1bea xamarin_main + 1898
	42  SecureCitizenMAUI8                  0x00000001023459d4 main + 68
	43  dyld                                0x000000010ad363e0 start_sim + 10
	44  ???                                 0x00000002029bf366 0x0 + 8633709414
)
**ObjCRuntime.ObjCException:** 'Loading...'

Code of Conduct

  • I agree to follow this project's Code of Conduct
@snice1981
Copy link

snice1981 commented Nov 1, 2024

Hi

I have exact same issue on iOS. On Android it works without any issue.

@SC-HeinrichG did you solve it?

@it11111111
Copy link

I am encountering the same issue. The logs are identical to mine

@snice1981
Copy link

5 months and the issue is still there, and no answer from the dev team....

@SC-HeinrichG
Copy link
Author

Hi Good day,
I originally log this issue, and I can mark it as resolved on both iOS and Android.
Please update to the latest version.
Sorry for the late reply.
Kind regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants