Phonegap推送插件:buildgind iOS模板错误

时间:2017-07-21 12:29:15

标签: ios cordova templates push-notification phonegap-plugins

我在我的应用上使用FCM开发了推送通知功能,适用于Android和iOS。

After I successuflly managed the push notifications on Android devices,我试图在iOS上做同样的事情。

所以,我开始创建模板,就像我为Android制作的那样。

但是,创建模板时,我收到了一个错误:

  

开始构建ios

     

上传iOS密钥......

     

已完成

     

上传应用程序模板......

     

已完成

     

建筑物状态:待定(13次尝试)

     

建筑状态:错误("插件安装 - 平台ios --project / tmp / gimlet / 2719563 / project --plugin phonegap-plugin-push@1.9.0" ;:获取插件" phonegap-plugin-push@1.9.0"通过npm

     

安装" phonegap-plugin-push" at" 1.9.0"对于ios

     

无法安装' phonegap-plugin-push':undefined   未定义   )

     

删除iOS密钥......

     

已完成

     

删除应用程序模板...

     

已完成

     

错误:构建状态:错误("插件安装 - 平台ios --project / tmp / gimlet / 2719563 / project --plugin phonegap-plugin-push@1.9.0":获取插件" phonegap-plugin-push@1.9.0"通过npm

     

安装" phonegap-plugin-push" at" 1.9.0"对于ios

     

无法安装' phonegap-plugin-push':undefined   未定义   )

这是我的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-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 name="phonegap-plugin-push" spec="1.9.0"/>

  <access origin="*" />
</widget>

config.xml文件位于APP.mobile项目中(不在APP.shared中)。我不明白为什么我可以为Android构建原生模板(它就像魅力一样),而不是在iOS中。

更新:总结了以下所有步骤:https://programmingistheway.wordpress.com/2017/07/19/devextremephonegap-how-to-manage-push-notifications-with-fcm/

1 个答案:

答案 0 :(得分:0)

要使用FCM,您应该使用插件的v2.x.x版本

最新发布的版本为v2.0.0-rc5,尝试使用该版本,甚至可以使用cordova plugin add https://github.com/phonegap/phonegap-plugin-push/从github安装

在你的config.xml中,你必须添加像这样的google-services json和plist文件

<platform name="android">
    <resource-file src="google-services.json" target="google-services.json" />
</platform>
<platform name="ios">
    <resource-file src="GoogleService-Info.plist" />
</platform>

在你的另一个问题中,你似乎正在使用github网址,不知道你为何回到1.9.0

相关问题