react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
732 stars 281 forks source link

Local Notification Error: `Unknown argument type 'UNNotificationRequest'` #359

Closed AlbertoMeQ closed 2 years ago

AlbertoMeQ commented 2 years ago

Hello,

I'm experiencing this error:

Unknown argument type 'UNNotificationRequest' in method -[RNCPushNotificationIOS addNotificationRequest:]. Extend RCTConvert to support this type.

-[RCTModuleMethod processMethodSignature]
    RCTModuleMethod.mm:376
-[RCTModuleMethod invokeWithBridge:module:arguments:]
facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&)
facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const
invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start_sim
0x0

I'm using Xcode 13.1 and React-native 0.59.9. How can I fix it?

The error says to "Extend RCTConvert to support this type." but where would I do that?

AlbertoMeQ commented 2 years ago

How could I fix this?

AlbertoMeQ commented 2 years ago

Turns out that the files RCTConvert+Notification.h and RCTConvert+Notification.m were not included in the project file, so the definition couldn't be found.