0

After following all the instructions here, didReceiveLocalNotification is never called.

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
  [RCTPushNotificationManager didReceiveLocalNotification:notification];
}

This causes the listeners to never fire:

PushNotificationIOS.addEventListener('localNotification', () => {
  console.log("never called")
});

The local notifications are received normally and didReceiveNotificationResponse is called, but PushNotificationiOS does not support didReceiveNotificationResponse.

How do I use React native's PushNotificationiOS library for iOS 11? It appears to rely on didReceiveLocalNotification being called, but it has been deprecated for a while now and is not working at all on iOS 11. Am I missing something?

jscs
  • 63,694
  • 13
  • 151
  • 195
user3247022
  • 69
  • 1
  • 9
  • If you're using the new `UserNotifications` framework, you can't use the old app delegate method at the same time. – jscs Jan 22 '18 at 20:44
  • This is not a duplicate of that question. This specifically relates to using React native's PushNotificationIOS library. It is not working as the docs imply it will. – user3247022 Jan 23 '18 at 00:30
  • The cause is as I stated; React Native is irrelevant. – jscs Jan 23 '18 at 00:44
  • It's not irrelevant. The PushNotificationsIOS docs say that the above code should work. Your comment is correct, but does not answer the question and the other question is asking something different. – user3247022 Jan 23 '18 at 01:36

0 Answers0