0
votes

I'm developing the push notification feature with FCM on my app, both for Android and iOS.

After I successuflly managed the push notifications on Android devices, I was trying to do the same on a iOS one.

So, I started creted the template, like I made for Android.

But, creating the template, I got an error:

Build for ios is started

Uploading iOS keys...

Completed

Uploading an application template...

Completed

Building status: pending (13 attempts)

Building status: error ("plugman install --platform ios --project /tmp/gimlet/2719563/project --plugin [email protected]": Fetching plugin "[email protected]" via npm

Installing "phonegap-plugin-push" at "1.9.0" for ios

Failed to install 'phonegap-plugin-push':undefined undefined )

Removing iOS keys...

Completed

Removing the application template...

Completed

Error: Building status: error ("plugman install --platform ios --project /tmp/gimlet/2719563/project --plugin [email protected]": Fetching plugin "[email protected]" via npm

Installing "phonegap-plugin-push" at "1.9.0" for ios

Failed to install 'phonegap-plugin-push':undefined undefined )

This is my config.xml file:

<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>

The config.xml file is in the project APP.mobile (not in APP.shared). I don't understand why I can build the native template for Android (and it works like a charm) and in iOS not.

UPDATE: Summarized all the steps here: https://programmingistheway.wordpress.com/2017/07/19/devextremephonegap-how-to-manage-push-notifications-with-fcm/

1
please check your ios version using cordova platform. may be your ios version is not supporting the plugin require ios version. - Hiten
Solved adding the "senderID" parameter in the config.xml. I noticed it is useless here for Android, but it is mandatory for iOS. - Piero Alberto
yes, you have to write senderId in ios build too. Otherwise they will generate the error. - Hiten

1 Answers

0
votes

To use FCM you should use v2.x.x version of the plugin

Latest published version is v2.0.0-rc5, try with that, or even install from github with cordova plugin add https://github.com/phonegap/phonegap-plugin-push/

In your config.xml you have to add the google-services json and plist files like this

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

In your other question you seem to be using github url, not sure why you went back to 1.9.0