Android 在DevExtreme/Phonegap上使用FCM推送通知

Android 在DevExtreme/Phonegap上使用FCM推送通知,android,ios,cordova,phonegap-plugins,devextreme,Android,Ios,Cordova,Phonegap Plugins,Devextreme,我用基于PhoneGap的多平台工具DevExtreme开发了我的应用程序 现在,我正在尝试使用phonegap插件推送管理推送通知 我的第一个简单目标是从FCM(Firebase Cloud Messaging)发送和接收一些通知 我更喜欢从Android开始,所以,我将我的Android应用程序设置为FCM。这里,我拿了发送者ID 在这些文档之后,我修改了config.xml,如下所示: <widget id="com.devexpress.apptemplate" version="

我用基于PhoneGap的多平台工具DevExtreme开发了我的应用程序

现在,我正在尝试使用phonegap插件推送管理推送通知

我的第一个简单目标是从FCM(Firebase Cloud Messaging)发送和接收一些通知

我更喜欢从Android开始,所以,我将我的Android应用程序设置为FCM。这里,我拿了发送者ID

在这些文档之后,我修改了config.xml,如下所示:

<widget id="com.devexpress.apptemplate" version="1.0" versionCode="1">
  <name>ApplicationTemplate</name>
  <description>Template</description>
  <preference name="phonegap-version" value="cli-6.4.0" />
  <preference name="permissions" value="none" />
  <preference name="prerendered-icon" value="true" />
  <preference name="android-windowSoftInputMode" value="adjustPan" />
  <preference name="SplashScreen" value="splash" />
  <preference name="SplashScreenDelay" value="60000" />
  <preference name="AutoHideSplashScreen" value="false" />
  <preference name="SplashShowOnlyFirstTime" value="false" />
  <preference name="FadeSplashScreen" value="false" />
  <preference name="ShowSplashScreenSpinner" value="false" />
  <preference name="DisallowOverscroll" value="true" />
  <preference name="StatusBarOverlaysWebView" value="false" />
  <preference name="StatusBarBackgroundColor" value="#000000" />
  <preference name="android-minSdkVersion" value="15" />
  <preference name="android-targetSdkVersion" value="22" />
  <!--<plugin name="cordova-plugin-file" />-->
  <plugin name="cordova-plugin-geolocation" />
  <plugin name="cordova-plugin-splashscreen" onload="true" />
  <plugin name="cordova-plugin-whitelist" />
  <plugin name="cordova-plugin-ios-longpress-fix" />
  <plugin name="cordova-plugin-statusbar" onload="true" />
  <plugin spec="https://github.com/phonegap/phonegap-plugin-push.git" source="git" >
    <param name="SENDER_ID" value="123456" />
  </plugin>
  <access origin="*" />
</widget>
这里开始疼痛

首先,我不知道pushServiceURL是否正确。如果我想从FCM发送一些通知,这是要使用的URL吗?

然后,我正确地创建了应用程序模板并构建了apk。但是,当然,当我将其安装到Android设备上并尝试从FCM发送通知时,我在应用程序上看不到任何内容。

此外,我正在尝试在应用程序启动后使用消息管理注册事件,但是我也没有看到该消息

所以,这里没什么用!既然没有文档,你能帮我吗

更新: 在完成phonegap插件推送的文档之后,我注意到我必须包含google-service.json。因此,我在config.xml中写道:

  <platform name="android">
    <resource-file src="google-services.json" target="google-services.json" />
  </platform>
<plugin spec="https://github.com/phonegap/phonegap-plugin-push.git" source="git" />
因为senderID现在位于google-services.json中。此外,我还删除了config.xml中的senderID:

  <platform name="android">
    <resource-file src="google-services.json" target="google-services.json" />
  </platform>
<plugin spec="https://github.com/phonegap/phonegap-plugin-push.git" source="git" />

我还在index.html()中的项目中包含了这个文件,但我不知道它是否正确。

解决了这个问题。我写道:

希望有帮助。

解决了它。我写道:

希望能有帮助