Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
🐧📝🐛 Issue #1470: Cannot install phonegap-plugin-push on master
Browse files Browse the repository at this point in the history
  • Loading branch information
macdonst committed May 4, 2017
1 parent 4fb7856 commit 632a4f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
22 changes: 7 additions & 15 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,40 @@

Plugin version | Cordova CLI | Cordova Android | Cordova iOS | CocoaPods
---- | ---- | ---- | ---- | ----
2.0.0 | 6.4.0 | 6.0.0 | 4.3.0 | 1.1.1
1.9.0 | 6.4.0 | 6.0.0 | 4.3.0 | 1.1.1
1.8.0 | 3.6.3 | 4.0.0 | 4.1.0 | N/A

To install from the command line:

```
phonegap plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
phonegap plugin add phonegap-plugin-push
```
or

```
cordova plugin add phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
cordova plugin add phonegap-plugin-push
```

It is also possible to install via repo url directly ( unstable )

```
phonegap plugin add https://github.com/phonegap/phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
phonegap plugin add https://github.com/phonegap/phonegap-plugin-push
```

or

```
cordova plugin add https://github.com/phonegap/phonegap-plugin-push --variable SENDER_ID="XXXXXXX"
cordova plugin add https://github.com/phonegap/phonegap-plugin-push
```

Where the `XXXXXXX` in `SENDER_ID="XXXXXXX"` maps to the project number in the [Google Developer Console](https://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwikqt3nyPjMAhXJ5iYKHR0qDcsQFggbMAA&url=https%3A%2F%2Fconsole.developers.google.com%2F&usg=AFQjCNF0eH059mv86nMIlRmfsf42kde-wA&sig2=BQ2BJpchw1CpGt87sk5p6w&bvm=bv.122852650,d.eWE). To find the project number login to the Google Developer Console, select your project and click the menu item in the screen shot below to display your project number.

![zzns8](https://cloud.githubusercontent.com/assets/353180/15588897/2fc14db2-235e-11e6-9326-f97fe0ec15ab.png)

If you are not creating an Android application you can put in anything for this value.
As of version 2.0.0 the SENDER_ID parameter has been removed at install time. Instead you put your google-services.json (Android) and/or GoogleService-Info.pList in the root folder of your project and the plugin's hooks will copy the file to the correct place in the platforms directory for you.

> Note: if you are using Ionic you may need to specify the SENDER_ID variable in your package.json.
```
"cordovaPlugins": [
{
"variables": {
"SENDER_ID": "XXXXXXX"
},
"locator": "phonegap-plugin-push"
}
]
Expand All @@ -72,9 +66,7 @@ If you are not creating an Android application you can put in anything for this
> Note: You need to specify the SENDER_ID variable in your config.xml if you plan on installing/restoring plugins using the prepare method. The prepare method will skip installing the plugin otherwise.
```
<plugin name="phonegap-plugin-push" spec="1.6.0">
<param name="SENDER_ID" value="XXXXXXX" />
</plugin>
<plugin name="phonegap-plugin-push" spec="1.6.0" />
```

## Android details
Expand Down
2 changes: 1 addition & 1 deletion scripts/copyAndroidFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function(ctx) {

fs.stat(settingsFile, function(err,stats) {
if (err) {
deferral.reject("To use this plugin on android you'll need to add a google-services.json file with the FCM project_info and place that into your www folder");
deferral.reject("To use this plugin on android you'll need to add a google-services.json file with the FCM project_info and place that into your project's root folder");
} else {

fs.createReadStream(settingsFile).pipe(fs.createWriteStream('platforms/android/google-services.json'));
Expand Down

0 comments on commit 632a4f1

Please sign in to comment.