Skip to content

[Bug]: Crash when using Onesignal with Plugin.LocalNotification #132

@markjackmilian

Description

@markjackmilian

What happened?

Environment
• OneSignalSDK.DotNet: version 5.2.1
• Plugin.LocalNotification: latest version
• Platform: [iOS]

Behavior
The exception occurs in two scenarios:
1. When the app is open and a push notification is received
2. When tapping on a received push notification
Exception Details

Cannot get the method descriptor for the selector 'onesignalUserNotificationCenter:didReceiveNotificationResponse: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/9/s/xamarin-macios/src/ObjCRuntime/DynamicRegistrar.cs:line 1052
   at Registrar.DynamicRegistrar.GetMethodNoThrow(Type original_type, Type type, String selector, Boolean is_static) in /Users/builder/azdo/_
*** Terminating app due to uncaught exception 'ObjCRuntime.RuntimeException', reason: 'Failed to lookup the required marshalling information.
Additional information:
	Selector: onesignalUserNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:
	Type: Plugin_LocalNotification_Platforms_UserNotificationCenterDelegate
 (ObjCRuntime.RuntimeException)
Cannot get the method descriptor for the selector 'onesignalUserNotificationCenter:didReceiveNotificationResponse:withCompletionHandler:' on the type 'Plugin.LocalNotification.Platforms.UserNotificationCenterDelegate', because the selector does not correspond to a method (ObjCRuntime.RuntimeException)

Steps to reproduce?

- Set up an app with OneSignalSDK.DotNet 5.2.1 and Plugin.LocalNotification
- Implement push notification handling
- Send a push notification to the app while it's running
- Alternatively, send a push notification and tap on it

What did you expect to happen?

The push notification should be handled correctly without throwing exceptions.

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions