react-native-macos/Libraries/PushNotificationIOS
ianlin e51cb349ce PushNotificationIOS: Use PushNotificationEventName as the key to store in the handler map
Summary:
If we are using the same handler for different events, e.g. both `notification` and `localNotification` use `_onNotification()` handler, the former listener stored in `_notifHandlers` would be overridden by the latter so it's impossible to remove the `notification` listener when we call `removeEventListener`.

This PR stores the listeners by using `pushNotificationEventName` (notification, localNotification, register or registrationError) as the key.

Use the same handler for `notification` and `localNotification`, both listeners will be removed when calling `removeEventListener`.
Closes https://github.com/facebook/react-native/pull/10776

Differential Revision: D4168722

Pulled By: hramos

fbshipit-source-id: d68581428d2acde314f7b5333feafe1ec7807159
2016-11-14 12:58:32 -08:00
..
RCTPushNotification.xcodeproj Travis CI reliability fixes: preload package manager and increase tim… 2016-10-16 15:43:44 -07:00
PushNotificationIOS.js PushNotificationIOS: Use PushNotificationEventName as the key to store in the handler map 2016-11-14 12:58:32 -08:00
RCTPushNotificationManager.h Remote notification completion handler 2016-10-26 21:43:48 -07:00
RCTPushNotificationManager.m Ensure notification payload is passed to completion handler 2016-11-14 11:28:47 -08:00