我正在阅读react-native-push-notification的安装说明,说明对于iOS,您使用的是@react-native-community/push-notification-ios。似乎您必须分别添加这两个模块。然而,我不知道在我的实际代码中应该使用哪一个。您是像react-native-push-notification中说的那样使用var PushNotification = require("react-native-push-notification");,还是使用@react-native-community/push-notification-ios中的import PushNotificationIOS from "@react-native-community/push-notification-ios";
发布于 2020-01-27 13:51:20
您的package.json中必须同时包含这两个包,但是除了finish处理程序as shown in the usage section here之外,您不需要将PushNotificationIOS用于任何其他操作。
不过,通常情况下,您只需要使用var PushNotification = require("react-native-push-notification")并调用处理程序。
https://stackoverflow.com/questions/59923365
复制相似问题