【发布时间】:2018-07-18 20:07:35
【问题描述】:
我使用 npm 模块https://github.com/zo0r/react-native-push-notification
我执行了自述文件中的步骤。 我只想将推送通知从我的后端发送到应用程序。所以我正在使用 Firebase 云消息传递。或者这不是一个好主意? 我在那里注册了我的应用程序,我不得不将这些代码粘贴到构建 gradle 文件中。
(<project>/build.gradle):
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:4.0.0'
}
}
(<project>/<app-module>/build.gradle):
dependencies {
// Add this line
compile 'com.google.firebase:firebase-core:16.0.0'
}
...
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
执行这些步骤后,我收到错误:“无法在 null 对象上调用方法 get()”,当使用 react native 运行此应用程序时。
我尝试使用 android studio 打开项目,但出现相同的错误消息。有人可以帮我吗?
【问题讨论】:
标签: javascript android reactjs react-native push-notification