我正在尝试将通知功能添加到我的本机应用程序中。似乎react-native-firebase是首选方法。但是我不想安装完整的模块,仅用于消息传递。根据此内容:https://github.com/invertase/react-native-firebase/tree/master/packages/messaging我安装了react-native-firebase / app,然后安装了react-native-firebase / messaging
npm install --save @react-native-firebase/app
npm install --save @react-native-firebase/messaging
然后我尝试将它们与
关联 react-native link react-native-firebase/app
react-native link react-native-firebase/messaging
。
两个操作均引发错误无法获取依赖项配置。
此页面:https://invertase.io/oss/react-native-firebase/guides/integrating-push-notifications-using-fcm指的是medium article,在本文中,已安装完整的react-native-firebase软件包。这是要走的路吗?仅通过安装我提到的相关子模块来实现这一目标是错误的吗?
我在这里做错了什么? 谢谢!
修改: 这是详细的输出:
> debug Available platforms: iOS, Android debug Targeted platforms: iOS,
> Android debug Getting project config for iOS... debug Getting project
> config for Android... debug Package to link:
> react-native-firebase/messaging error Failed to get dependency config
> debug Error: Failed to get dependency config
> at getDependencyConfig (/Users/user/ReactNativeProjects/project/node_modules/@react-native-community/cli/build/commands/link/getDependencyConfig.js:49:11)
> at Object.link [as func] (/Users/user/ReactNativeProjects/project/node_modules/@react-native-community/cli/build/commands/link/link.js:97:61)
> at Promise.resolve.then (/Users/user/ReactNativeProjects/project/node_modules/@react-native-community/cli/build/cliEntry.js:152:22)
> at process._tickCallback (internal/process/next_tick.js:68:7)
> at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
> at startup (internal/bootstrap/node.js:283:19)
> at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)