react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
749 stars 286 forks source link

Typo in README.md #189

Closed JamesPerlman closed 4 years ago

JamesPerlman commented 4 years ago

Bug report

In the instructions for integrating UNUserNotificationCenter:

- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
{
  completionHandler(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge);
}

This works however it is only correct because luckily the first 3 options in the UNAuthorizationOptions enum are identical in value to the elements of UNNotificationPresentationOptions. The completionHandler should be called like so:

completionHandler(UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert)
Naturalclar commented 4 years ago

@JamesPerlman thanks for raising the issue! This issue is solved in #172