CatalystCode / react-native-azurenotificationhub

React Native module to support Azure Notification Hub push notifications on Android, iOS, and Windows.
MIT License
47 stars 75 forks source link

Fix for: `remoteNotificationReceived` is not a supported event type for RCTAzureNotificationHubManager #166

Open Doychev opened 4 years ago

Doychev commented 4 years ago

I have found a little bug, not 100% sure if it's a configuration problem or a general iOS issue. I believe it's a single letter typo - remoteNotificationReceived is expected to have a capital R in front.

TL;DR - in node_modules/react-native-azurenotificationhub/ios/AzureNotificationHubIOS.js:25 - change remoteNotificationReceived to RemoteNotificationReceived

--

Environment

Issues and Steps to Reproduce

When executing: NotificationHub.addEventListener('notification', this._onRemoteNotification); the app crashes.

Expected Behavior

Register for notifications.

Actual Behavior

remoteNotificationReceived is not a supported event type for RCTAzureNotificationHubManager. Supported events are: localNotificationReceived, RemoteNotificationReceived, remoteNotificationRegistered, remoteNotificationRegisteredError, azureNotificationHubRegistered, azureNotificationHubRegisteredError

-[RCTEventEmitter addListener:] RCTEventEmitter.m:78 __invoking_ -[NSInvocation invoke] -[NSInvocation invokeWithTarget:] -[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 UIApplicationMain main start 0x0

Screenshot_1

roycwc commented 4 years ago

159

possible name collision with

NSString *const RCTRemoteNotificationReceived = @"RemoteNotificationReceived";

in

node_modules/@react-native-community/push-notification-ios/ios/RNCPushNotificationIOS.m
rlsbelmiro commented 3 years ago

Hello, any update about this problem?

prasadmaduranga commented 2 years ago

Got the same issue here. Any updates?