如何将ReactNative PushNotificationIOS与UserNotifications框架一起使用?

时间:2018-01-22 20:23:24

标签: ios react-native push-notification react-native-push-notification

遵循所有说明here后,永远不会调用didReceiveLocalNotification。

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

这会导致听众永远不会开火:

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

正常收到本地通知并调用didReceiveNotificationResponse,但PushNotificationiOS不支持didReceiveNotificationResponse。

如何在iOS 11中使用React native的PushNotificationiOS库?它似乎依赖于调用didReceiveLocalNotification,但它现在已被弃用了一段时间,并且在iOS 11上根本不起作用。我错过了什么?

0 个答案:

没有答案