Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
69e86d9
Added VoIP Notifications support for iOS (#2194)
jlorente Feb 22, 2018
6888467
Issue #2051: Plugin not working on android 4.4 but working in 5,6 and 7
macdonst Feb 27, 2018
f24aed6
:bug: Issue #2052: ServiceWorker.js Folder Instead of File
macdonst Feb 28, 2018
bd85f4b
:bookmark: Bumping plugin version to 2.2.0
macdonst Feb 28, 2018
a570584
2.2.0
macdonst Feb 28, 2018
0dc1d65
Update CHANGELOG
macdonst Feb 28, 2018
8828629
🐛 Issue #2237: Installation problems
macdonst Mar 1, 2018
5c0943d
:bookmark: Bumping plugin version to 2.2.1
macdonst Mar 1, 2018
b046cc9
2.2.1
macdonst Mar 1, 2018
c891053
:sparkles: PushNotification.hasPermission() is now supported in the b…
ntamas Mar 6, 2018
eaec03b
Android fix to check if the channel is setup. Previously we only cre…
Mar 7, 2018
576cbc6
⬆️🐧🐛 Issue #2229: Multiple dex files define Landroid/support/v13/view…
macdonst Mar 7, 2018
432330d
:bug::apple: Issue #2251: Apple rejected my app update because of VoI…
macdonst Mar 8, 2018
24d5110
:memo: Formatting table of options for ios.
fredgalvao Mar 9, 2018
ee18f1a
:bookmark: Bumping plugin version to 2.2.2
macdonst Mar 9, 2018
bd868ea
2.2.2
macdonst Mar 9, 2018
4d89cc7
📝 Remove link to workshop
macdonst Mar 26, 2018
fe6cb91
:heavy_plus_sign: add dependency on cordova-support-google-services (…
chemerisuk Apr 9, 2018
a2be699
Added description of sample JSON message format for Android and iOS t…
ptandler Apr 26, 2018
df98516
:memo: Fix syntax highlighting in payload doc
macdonst Apr 26, 2018
98c805c
:memo: Update installation requirements table
macdonst Apr 26, 2018
2a21a6e
Clarify Android push icon color issues (#2345)
xwipeoutx May 11, 2018
3ec6c96
Update PAYLOAD.md
macdonst May 11, 2018
cb85fbf
Android channel vibration (#2353)
KirbySSmith May 11, 2018
7d8d633
:memo: Fixing typos, links to official iconography
fredgalvao May 12, 2018
9fdeff1
Remove the setting applicationId code (#2367)
jcesarmobile May 18, 2018
7390a82
:heavy_plus_sign: adding dependency to phonegap-plugin-multidex
macdonst May 22, 2018
866f950
:bookmark: Bumping plugin version to 2.2.3
macdonst May 22, 2018
d5f3e70
2.2.3
macdonst May 22, 2018
368450a
:memo: Issue #2381: Plugin conflict error
macdonst May 23, 2018
1383dd9
📝 Issue #2388: Is it possible to update PHONEGAP_BUILD.md?
macdonst May 25, 2018
a806b03
:fire: Remove push.gradle file
macdonst May 28, 2018
80b8453
🔧 Add lockbot to repo
macdonst Jun 3, 2018
1263fd2
🔧 Adding stale issue bot config to repo
macdonst Jun 3, 2018
3bc6c4d
:wrench: Add retest label to prevent issue from becoming stale
macdonst Jun 4, 2018
62168ae
:memo: Issue #2095: No notification received on Oppo,Mi
macdonst Jun 4, 2018
e528b1c
:wrench: add docs label to stale exempt list
macdonst Jun 4, 2018
d2367cf
AWS Pinpoint Enhancement (#2398)
l1nknyto Jun 4, 2018
4b1671c
Update API.md (#2409)
miqmago Jun 6, 2018
bd135d9
AWS Pinpoint Enhancement - picture message (#2411)
l1nknyto Jun 7, 2018
a70a118
Issue #2266:Update to UNUserNotification API of iOS 10+ (#2363)
merrygobyebye Jun 7, 2018
6d38ec3
the completionHandler moved in the else statement (#2417)
knight9999 Jun 21, 2018
11d7a6c
Call registerForRemoteNotifications even if isRegisteredForRemoteNoti…
jcesarmobile Jun 21, 2018
87ded60
➕Update cordova-support-google-services to 1.2.0, change default valu…
chemerisuk Jul 2, 2018
683696e
:sparkles: Added a clearNotification method to clear a single notific…
DavidBriglio Jul 3, 2018
e94fb9e
Update PAYLOAD.md (#2457)
andreszs Jul 3, 2018
fa2434a
:memo: Update payload with fcm instead of gcm where appropriate
macdonst Jul 3, 2018
73b927c
:bug: :apple: Issue #1141: Clear application badge on first launch (#…
merrygobyebye Jul 3, 2018
1ecff81
:wrench: Disable stalebot
macdonst Jul 9, 2018
a1e0e46
:memo: improve iOS workaround (#2477)
DarkIsDude Jul 9, 2018
2b4748c
clearAll notifications on Android if count zero when in background (#…
chriscant Aug 14, 2018
d5d2e9d
remove unused variable (#2467)
knight9999 Aug 14, 2018
110e3c2
:apple: :sparkles: :memo: Issue #2191: Implement the ability to clear…
merrygobyebye Aug 15, 2018
4cf09ab
🐛🐧 Issue #2489: Crash reports on Google Play Store - firebase Illegal…
macdonst Aug 15, 2018
31447c5
:memo: Properly encode JSON payload examples
macdonst Aug 16, 2018
e056943
📝 Issue #2507: Delete Android channel and recreate it in order to cha…
macdonst Aug 16, 2018
5c6446d
📝 Issue #2487: Custom notification icon for android + documentation
macdonst Aug 17, 2018
7bde3b4
Set theme jekyll-theme-slate
macdonst Aug 20, 2018
532be4b
Add missing syntax highlighting to docs (#2573)
pataar Oct 2, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Configuration for lock-threads - https://github.com/dessant/lock-threads

# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 30

# Issues and pull requests with these labels will not be locked. Set to `[]` to disable
exemptLabels: []

# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: false

# Comment to post before locking. Set to `false` to disable
lockComment: This thread has been automatically locked.

# Limit to only `issues` or `pulls`
# only: issues

# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
# exemptLabels:
# - help-wanted
# lockLabel: outdated

# pulls:
# daysUntilLock: 30
1,911 changes: 992 additions & 919 deletions CHANGELOG.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ of the `Firebase Cloud Messaging` library. More details are available in the
# Do you like tutorial? You get tutorial!

* [PhoneGap Day US Push Workshop 2016 (using node-gcm)](http://macdonst.github.io/push-workshop/)
* [PhoneGap Day EU Push Workshop 2016 (using PhoneGap Push)](http://macdonst.github.io/push-workshop-eu/)

# Thanks to all our contributors

Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-slate
503 changes: 305 additions & 198 deletions docs/API.md

Large diffs are not rendered by default.

128 changes: 62 additions & 66 deletions docs/INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,98 +1,100 @@
# Installation

- [Installation Requirements](#installation-requirements)
- [Android details](#android-details)
- [Compilation](#compilation)
- [Co-existing with Facebook Plugin](#co-existing-with-facebook-plugin)
- [Co-existing with plugins that use Firebase](#co-existing-with-plugins-that-use-firebase)
- [Common errors](#common-errors)
- [minSdkVersion === 14](#minsdkversion--14)
- [Multidex](#multidex)
- [More than one library with package name 'com.google.android.gms'](#more-than-one-library-with-package-name-comgoogleandroidgms)
- [Browser details](#browser-details)
- [Browser quirks](#browser-quirks)
- [Browser Support](#browser-support)
- [iOS details](#ios-details)
- [Xcode](#xcode)
- [Bitcode](#bitcode)
- [CocoaPods](#cocoapods)
- [Common CocoaPod Installation issues](#common-cocoapod-installation-issues)
- [CocoaPod Disk Space](#cocoapod-disk-space)
- [Library not found for -lPods-Appname](#library-not-found-for--lpods-appname)
- [Library not found for -lGoogleToolboxForMac](#library-not-found-for--lgoogletoolboxformac)
- [Module FirebaseInstanceID not found](#module-firebaseinstanceid-not-found)
- [Additional Resources](#additional-resources)
* [Installation Requirements](#installation-requirements)
* [Android details](#android-details)
* [Compilation](#compilation)
* [Co-existing with Facebook Plugin](#co-existing-with-facebook-plugin)
* [Co-existing with plugins that use Firebase](#co-existing-with-plugins-that-use-firebase)
* [Common errors](#common-errors)
* [minSdkVersion === 14](#minsdkversion--14) - [Multidex](#multidex) - [More than one library with package name 'com.google.android.gms'](#more-than-one-library-with-package-name-comgoogleandroidgms)
* [Browser details](#browser-details)
* [Browser quirks](#browser-quirks)
* [Browser Support](#browser-support)
* [iOS details](#ios-details)
* [Xcode](#xcode)
* [Bitcode](#bitcode)
* [CocoaPods](#cocoapods)
* [Common CocoaPod Installation issues](#common-cocoapod-installation-issues)
* [CocoaPod Disk Space](#cocoapod-disk-space)
* [Library not found for -lPods-Appname](#library-not-found-for--lpods-appname)
* [Library not found for -lGoogleToolboxForMac](#library-not-found-for--lgoogletoolboxformac)
* [Module FirebaseInstanceID not found](#module-firebaseinstanceid-not-found)
* [Additional Resources](#additional-resources)

## Installation Requirements

Plugin version | Cordova CLI | Cordova Android | Cordova iOS | CocoaPods
---- | ---- | ---- | ---- | ----
2.0.0 | 7.0.0 | 6.2.1 | 4.4.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
| Plugin version | Cordova CLI | Cordova Android | Cordova iOS | CocoaPods |
| -------------- | ----------- | --------------- | ----------- | --------- |
| 2.2.0 | 7.1.0 | 7.1.0 | 4.5.0 | 1.1.1 |
| 2.1.2 | 7.1.0 | 6.3.0 | 4.5.0 | 1.1.1 |
| 2.1.0 | 7.1.0 | 6.3.0 | 4.4.0 | 1.1.1 |
| 2.0.0 | 7.0.0 | 6.2.1 | 4.4.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:

```
```bash
phonegap plugin add phonegap-plugin-push
```

or

```
```bash
cordova plugin add phonegap-plugin-push
```

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

```
```bash
phonegap plugin add https://github.com/phonegap/phonegap-plugin-push
```

or

```
```bash
cordova plugin add https://github.com/phonegap/phonegap-plugin-push
```

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 then add the following lines into your config.xml.

In the platform tag for Android add the following resource-file tag if you are using cordova-android 7.0 or greater:

```
```xml
<platform name="android">
<resource-file src="google-services.json" target="app/google-services.json" />
</platform>
```

If you are using cordova-android 6.x or earlier, add the following resource-file tag:

```
```xml
<platform name="android">
<resource-file src="google-services.json" target="google-services.json" />
</platform>
```

By default, on iOS, the plugin will register with APNS. If you want to use FCM on iOS, in the platform tag for iOS add the resource-file tag:

```
```xml
<platform name="ios">
<resource-file src="GoogleService-Info.plist" />
</platform>
```

> Note: if you are using Ionic you may need to specify the SENDER_ID variable in your package.json.

```
```json
"cordovaPlugins": [
{
"locator": "phonegap-plugin-push"
}
]
```

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

```
```xml
<plugin name="phonegap-plugin-push" spec="2.0.0" />
```

Expand All @@ -102,15 +104,15 @@ By default, on iOS, the plugin will register with APNS. If you want to use FCM o

As of version 2.1.0 the plugin has been switched to using pinned version of Gradle libraries. You will need to ensure that you have installed the following items through the Android SDK Manager:

- Android Support Repository version 47+
* Android Support Repository version 47+

![android support library](https://user-images.githubusercontent.com/353180/33042340-7ea60aaa-ce0f-11e7-99f7-4631e4c3d7be.png)

For more detailed instructions on how to install the Android Support Library visit [Google's documentation](https://developer.android.com/tools/support-library/setup.html).

*Note:* if you are using an IDE to like Eclipse, Xamarin, etc. then the Android SDK installed by those tools may not be the same version as the one used by the Cordova/PhoneGap CLI while building. Please make sure your command line tooling is up to date with the software versions above. An easy way to make sure you up to date is to run the following command:
_Note:_ if you are using an IDE to like Eclipse, Xamarin, etc. then the Android SDK installed by those tools may not be the same version as the one used by the Cordova/PhoneGap CLI while building. Please make sure your command line tooling is up to date with the software versions above. An easy way to make sure you up to date is to run the following command:

```
```bash
android update sdk --no-ui --filter "extra"
```

Expand All @@ -120,38 +122,32 @@ There are a number of Cordova Facebook Plugins available but the one that we rec

To add to your app:

```
```bash
phonegap plugin add --save cordova-plugin-facebook4 --variable APP_ID="App ID" --variable APP_NAME="App Name"
```

or

```
```bash
cordova plugin add --save cordova-plugin-facebook4 --variable APP_ID="App ID" --variable APP_NAME="App Name"
```

### Co-existing with plugins that use Firebase

Problems may arise when push plugin is used along plugins that implement Firebase functionality (cordova-plugin-firebase-analytics, for example). Firebase uses `@string/google_app_id`, as does the push plugin, though the value format differs, causing problems like this: `Invalid google_app_id. Firebase Analytics disabled`.
Problems may arise when push plugin is used along plugins that implement Firebase functionality (cordova-plugin-firebase-analytics, for example). Both plugins include a version of the FCM libraries.

To make the two work together, you need to migrate your GCM project from Google console to Firebase console:

1) In Firebase console - [import your existing GCM project](https://firebase.google.com/support/guides/google-android#migrate_your_console_project), don't create a new one.
2) Set your `SENDER_ID` variable to match the id of your imported Firebase project. In case of cordova, your `config.xml` would look something like this:
1. In Firebase console - [import your existing GCM project](https://firebase.google.com/support/guides/google-android#migrate_your_console_project), don't create a new one.
2. Set your `FCM_VERSION` variable to match the version used in the other plugin. In case of cordova, your `config.xml` would look something like this:

```xml
<plugin name="phonegap-plugin-push" spec="~1.10.0">
<variable name="SENDER_ID" value="1:956432534015:android:df201d13e7261425" />
<plugin name="phonegap-plugin-push" spec="~2.2.0">
<variable name="FCM_VERSION" value="15.0.0" />
</plugin>
```
3) In your JavaScript, when you init the PushPlugin, senderID remains the same format as before:
```javascript
PushNotification.init({
android: {
senderID: 956432534015
}
});
```

*Note:* No changes on the back-end side are needed: [even though recommended](https://developers.google.com/cloud-messaging/android/android-migrate-fcm#update_server_endpoints), it isn't yet required and sending messages through GCM gateway should work just fine.
_Note:_ No changes on the back-end side are needed: [even though recommended](https://developers.google.com/cloud-messaging/android/android-migrate-fcm#update_server_endpoints), it isn't yet required and sending messages through GCM gateway should work just fine.

### Common errors

Expand Down Expand Up @@ -206,7 +202,7 @@ Then at least one other plugin you have installed is using an outdated way to de
This causes gradle to fail, and you'll need to identify which plugin is causing it and request an update to the plugin author, so that it uses the proper way to declare dependencies for cordova.
See [this for the reference on the cordova plugin specification](https://cordova.apache.org/docs/en/5.4.0/plugin_ref/spec.html#link-18), it'll be usefull to mention it when creating an issue or requesting that plugin to be updated.

Common plugins to suffer from this outdated dependency management are plugins related to *facebook*, *google+*, *notifications*, *crosswalk* and *google maps*.
Common plugins to suffer from this outdated dependency management are plugins related to _facebook_, _google+_, _notifications_, _crosswalk_ and _google maps_.

#### More than one library with package name 'com.google.android.gms'

Expand Down Expand Up @@ -238,7 +234,7 @@ When you run `phonegap serve` to test browser push point your browser at `http:/

### Browser Support

Chrome 49+
Chrome 49+
Firefox 46+

## iOS details
Expand Down Expand Up @@ -269,22 +265,21 @@ Required `cordova-ios` minimum version: `4.3.0`

Required `CocoaPods` minimum version: `1.0.1`


To install CocoaPods, please follow the installation instructions [here](https://guides.cocoapods.org/using/getting-started). After installing CocoaPods, please run:

pod setup

This will clone the required CocoaPods specs-repo into your home folder at `~/.cocoapods/repos`, so it might take a while. See the [CocoaPod Disk Space](#cocoapod-disk-space) section below for more information.


Version `2.0.0` (and above) of this plugin supports [CocoaPods](https://cocoapods.org) installation of the [Firebase Cloud Messaging](https://cocoapods.org/pods/FirebaseMessaging) library.

If you are installing this plugin using `npm`, and you are using version `6.1.0` or greater of the `cordova-cli`, it will automatically download the right version of this plugin for both your platform and cli.

If you are on a `cordova-cli` version less than `6.1.0`, you will either have to upgrade your `cordova-cli` version, or install the plugin explicitly:

i.e.
```

```bash
cordova plugin add phonegap-plugin-push@1.8.1
```

Expand All @@ -311,7 +306,7 @@ Please run the command `pod repo update` and re-install the plugin. You would on

Running `pod setup` can take over 1 GB of disk space and that can take quite some time to download over a slow internet connection. If you are having issues with disk space/network try this neat hack from @VinceOPS.

```
```bash
git clone --verbose --depth=1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
pod setup --verbose
```
Expand All @@ -337,6 +332,8 @@ ld: library not found for -lGoogleToolboxForMac

Workarounds are to add the platform first and install the plugins later, or to manually run pod install on projectName/platforms/ios.

Another workaround is to go to build phases in your project at Link Binary Libraries and add `libPods-PROJECTNAME.a` and `libGoogleToolboxForMac.a`

##### Module FirebaseInstanceID not found

If you run into an error like:
Expand All @@ -347,7 +344,7 @@ module FirebaseInstanceID not found

You may be running into a bug in cordova-ios. The current workaround is to run `pod install` manually.

```
```bash
cd platforms/ios
pod install
```
Expand All @@ -358,16 +355,15 @@ The push plugin enables you to play sounds and display different icons during pu

You can now use the `resource-file` tag to deliver the image and sound files to your application. For example if you wanted to include an extra image file for only your Android build you would add the `resource-file` tag to your android `platform` tag:

```
```xml
<platform name="android">
<resource-file src="myImage.png" target="res/drawable/myImage.png" />
</platform>
```

or if you wanted to include a sound file for iOS:


```
```xml
<platform name="ios">
<resource-file src="mySound.caf" />
</platform>
Expand Down
Loading