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

(ios) pass data to on('notification') while app is in foreground #2907

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6f0d362
Update plugin.xml
duca14036 Jul 23, 2019
f812533
show notification when app is active
duca14036 Aug 6, 2019
9fbef3b
notification while app run
duca14036 Aug 22, 2019
2f4896f
Merge branch 'master' of https://github.com/phonegap/phonegap-plugin-…
duca14036 Apr 30, 2020
0cf2bd3
update to latest Firebase/Messaging
duca14036 Apr 30, 2020
7ddacb0
Release 2.3.1
duca14036 Jun 19, 2020
f8aec5d
chore: update plugin package (#1)
erisu Aug 12, 2020
e89d55c
cleanup: remove unused dependencies (#2)
erisu Aug 12, 2020
3fa9537
refactor(eslint): update dependencies w/ fixes (#3)
erisu Aug 12, 2020
3f4fb09
chore(ci): update travis configs (#5)
erisu Aug 12, 2020
073d418
chore(github-pages): remove config (#4)
erisu Aug 12, 2020
f118ba7
chore: update npm & git ignore list (#6)
erisu Aug 12, 2020
20d9dc4
chore: update version requirements (#7)
erisu Aug 12, 2020
3e7fc65
feat: remove ordova-support-google-services dependency (#8)
erisu Aug 12, 2020
c6209e7
chore: update xml namespace (#9)
erisu Aug 12, 2020
79c2d70
chore: match plugin.xml version w/ package.json (#10)
erisu Aug 12, 2020
d7bc4ad
style(md): format with md all in one (vscode) (#11)
erisu Aug 12, 2020
27967cc
feat(ios): support critical alert notifications (#12)
erisu Aug 12, 2020
1fcb939
breaking(android): move clearAllNotifications to destroy from pause (…
erisu Aug 12, 2020
6361d5d
chore(type-definition): Update PushNotificationStatic (#14)
erisu Aug 12, 2020
6505dde
fix(android): enable lights when lightColor is set (#15)
erisu Aug 12, 2020
185f454
breaking(android): drop phonegap-plugin-multidex dependency (#21)
erisu Aug 28, 2020
7143d59
chore(android): bump com.android.support:support-v13:28.0.0 (#20)
erisu Aug 28, 2020
e471bbb
ci(gh-actions): add workflow (#23)
erisu Aug 28, 2020
061c498
chore: add missing build of push.js (#22)
erisu Aug 28, 2020
1ae3428
breaking(android): bump fcm@18.+ (#19)
erisu Aug 29, 2020
f931bf3
chore: update ticket management (#27)
erisu Sep 1, 2020
38e4316
core(ios): use latest firebase library (#24)
erisu Sep 1, 2020
826e3ae
chore(android): cleanup & format (#26)
erisu Sep 1, 2020
fe1cdf2
doc: update various markdown docs (#28)
erisu Sep 4, 2020
67baa04
fix(browser): corrected path to manifest file. (#32)
jgmdev Sep 10, 2020
edaff20
feature: android notification data pass (#31)
erisu Sep 10, 2020
0962b76
chore(npm): properly configure for scope package (#33)
erisu Sep 11, 2020
dedf439
feat(ios): increase firebase framework to 6.32.2 (#42)
ucsbricks Oct 22, 2020
3298b62
fix(android): Use app name for default channel (#49)
dertieran Oct 22, 2020
ea8ea28
doc: cleanup docs (#51)
erisu Oct 23, 2020
08b452c
chore(android): set requirement >= 8.0.0 (#52)
erisu Oct 23, 2020
35597dc
doc(android): enable & set notification light with lightColor (#54)
erisu Oct 25, 2020
d793227
fix(android): missing channel description crash (#53)
erisu Oct 25, 2020
f31f040
Merge commit 'd7932274652ca2f977c67580b1dcbf1ed22fa878'
duca14036 Oct 27, 2020
45dbcb0
chore(npm): rebuilt package-lock.json (#55)
erisu Oct 28, 2020
fc27b40
release(1.0.0): version & changelog
erisu Nov 8, 2020
6a71d66
chore: bump version to 1.0.1-dev.0
erisu Nov 11, 2020
79333b2
fix: incorrect initial cordova-cli requirement
erisu Nov 11, 2020
7d8cb73
Merge commit '79333b25e1ff68fea377be499da91528c82fa21f'
duca14036 Nov 18, 2020
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
844 changes: 840 additions & 4 deletions .editorconfig

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
www/push.js
16 changes: 0 additions & 16 deletions .eslintrc

This file was deleted.

17 changes: 17 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root: true
extends: '@cordova/eslint-config/browser'
parser: '@babel/eslint-parser'
globals:
cordova: true
rules:
indent: ["error", 2]

overrides:
- files: [spec/**/*.js, example/server/**/*.js]
extends: '@cordova/eslint-config/node-tests'
rules:
indent: ["error", 2]

- files: [src/windows/**/*.js]
globals:
Windows: true
160 changes: 85 additions & 75 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,106 +2,116 @@

We love pull requests from everyone.

[Fork](https://help.github.com/articles/fork-a-repo/), then [clone](https://help.github.com/articles/cloning-a-repository/) the repo:
## How to Contribute

```
git clone [email protected]:your-username/phonegap-plugin-push.git
```
There are multiple ways to contribute:

Set up a branch for your feature or bugfix with a link to the original repo:
* Submit Issue Tickets (Bugs Reports)
* Improve Documentation
* Contribute Code

```
git checkout -b my-awesome-new-feature
git push --set-upstream origin my-awesome-new-feature
git remote add upstream https://github.com/phonegap/phonegap-plugin-push.git
```
## Setup for Contributing Codde

Set up the project:
Before we can start submitting code contributions, we setup locally a workspace where we can work on the code.

```
npm install
```
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repo by following the GitHub's "[Fork a repo](https://help.github.com/articles/fork-a-repo/)" quickstart guide.
2. [Clone](https://help.github.com/articles/cloning-a-repository/) the newly forked repo locally.

Make sure the tests pass before changing anything:
```bash
git clone [email protected]:your-username/phonegap-plugin-push.git
```

```
npm test
```
## Make First Codde Contribution

Make your change. Add tests for your change. Make the tests pass:
1. Create a new branch where you will make your feature or bugfix changes, with a link to the original repo:

```
npm test
```
```bash
git checkout -b my-awesome-new-feature
git push --set-upstream origin my-awesome-new-feature
git remote add upstream https://github.com/havesource/cordova-plugin-push.git
```

Commit changes:
2. Install project dependencies

```
git commit -m "Cool stuff"
```
```bash
npm install
```

Consider starting the commit message with an applicable emoji:
* :art: `:art:` when improving the format/structure of the code
* :zap: `:zap:` when improving performance
* :non-potable_water: `:non-potable_water:` when plugging memory leaks
* :memo: `:memo:` when writing docs
* :ambulance: `:ambulance:` a critical hotfix.
* :sparkles: `:sparkles:` when introducing new features
* :bookmark: `:bookmark:` when releasing / version tags
* :rocket: `:rocket:` when deploying stuff
* :penguin: `:penguin:` when fixing something on Android
* :apple: `:apple:` when fixing something on iOS
* :checkered_flag: `:checkered_flag:` when fixing something on Windows
* :bug: `:bug:` when fixing a bug
* :fire: `:fire:` when removing code or files
* :green_heart: `:green_heart:` when fixing the CI build
* :white_check_mark: `:white_check_mark:` when adding tests
* :lock: `:lock:` when dealing with security
* :arrow_up: `:arrow_up:` when upgrading dependencies
* :arrow_down: `:arrow_down:` when downgrading dependencies
* :shirt: `:shirt:` when removing linter warnings
* :hammer: `:hammer:` when doing heavy refactoring
* :heavy_minus_sign: `:heavy_minus_sign:` when removing a dependency.
* :heavy_plus_sign: `:heavy_plus_sign:` when adding a dependency.
* :wrench: `:wrench:` when changing configuration files.
* :globe_with_meridians: `:globe_with_meridians:` when dealing with internationalization and localization.
* :pencil2: `:pencil2:` when fixing typos.
* :hankey: `:hankey:` when writing bad code that needs to be improved.
* :package: `:package:` when updating compiled files or packages.

Make sure your branch is up to date with the original repo:
3. Make sure that the tests are pass before and after making any changes:

```
git fetch upstream
git merge upstream/master
```
```bash
npm test
```

Review your changes and any possible conflicts and push to your fork:
4. After making changes and tests are passing, commit the changes:

```
git push origin
```bash
git commit -m "feat(android): my new cool feature"
```

❗ Make sure to follow the [Commit Message and PR Title Semantics](#Commit-Message-and-PR-Title-Semantics)

5. Push your commits to your fork:

```bash
git push origin
```

6. [Submit a pull request](https://help.github.com/articles/creating-a-pull-request/).

## Commit Message and PR Title Semantics

When writting a commit message or title to a PR, please make sure to follow the convention described below to help use understand what is being reviewed. The semantics will be validated automatticly by a semantic checker.

### `Types`

There are various `types` of commits that can be choosed from. The following `types`, described below, should be used when writting a commit message to help us understand the type of changes we are reviewing.

* `ci:` - When change are made to the CI configuration files.
* `chore:` - When changes do not modify source or test files. E.g. Wpdating a dependency that does not require code changes.
* `docs:` - When making documentation only changes.
* `feat:` - When adding a new features. E.g. adding a new parameter to perform a new task.
* `fix:` - When making a bug fix.
* `refactor:` - When making code change that does not fix or add new features.
* `perf:` - When making code changes to improve performance.
* `revert:` - When reverting a previous commit.
* `style:` - When making formatting changes that does not affect the code. E.g. commas, semi-colons, whitespaces, indentioned, etc.
* `test:` - Adding missing or correcting existing tests.


### `Scope`

`Scope` can also be applied to the commit messages to provide more insight to where the changes are made. For example: if a change is being made only to the `android` source code, you can use `android` as the scope.

Example: "**feat(android): added support for abc**"

## Update with Upstream

Periodically your cloned repo's branch and PR may become out-of-dated with upstream's master. You should make sure your branch is up-to-date with the original repo:

```bash
git fetch upstream
git merge upstream/master
```

[Submit a pull request](https://help.github.com/articles/creating-a-pull-request/).
## After Submitting a PR

At this point you're waiting on us. We do our best to keep on top of all the pull requests. We may suggest some changes, improvements or alternatives.

Some things that will increase the chance that your pull request is accepted:

- Write tests.
- Write a [good commit message](http://chris.beams.io/posts/git-commit/).
- Make sure the PR merges cleanly with the latest master.
- Describe your feature/bugfix and why it's needed/important in the pull request description.

* Write tests
* Write a good commit message
* Make sure the PR merges cleanly with the latest master.
* Describe your feature/bugfix and why it's needed/important in the pull request description.
* Link your PR with the associated issue ticket is present

## Editor Config

The project uses [.editorconfig](http://editorconfig.org/) to define the coding
style of each file. We recommend that you install the Editor Config extension
for your preferred IDE. Consistency is key.
The project uses [.editorconfig](https://editorconfig.org/) to define the coding style of each file. We recommend that you install the Editor Config extension for your preferred IDE. Consistency is key.

## ESLint

The project uses [.eslint](http://eslint.org/) to define the JavaScript
coding conventions. Most editors now have a ESLint add-on to provide on-save
or on-edit linting.
The project uses [.eslint](https://eslint.org/) to define the JavaScript coding conventions. Most editors now have a ESLint add-on to provide on-save or on-edit linting.

We look forward to your contributions!
26 changes: 0 additions & 26 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: 🐛 Bug Report
about: If something isn't working as expected.

---

# Bug Report

## Expected Behaviour

## Actual Behaviour

## Reproduce Scenario (including but not limited to)

### Steps to Reproduce

### Platform and Version (eg. Android 5.0 or iOS 9.2.1)

### (Android) Device Vendor (e.g. Samsung, HTC, Sony...)

### `cordova info` Printout

<!--
Please attach the full `cordova info` print out.
This printoput contains all the necessary information for debugging.
The information it provides:
* Versions of the Cordova Packages
* Project Installed Platforms & Versions
* Project Installed Plugins & Versions
* Development Environment Information
* <Platform> Environment Information
* Project Setting Files (config.xml and package.json)
-->

### Sample Push Data Payload

### Sample Code that illustrates the problem

### Logs taken while reproducing problem
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 🚀 Feature Request
about: A suggestion for a new functionality

---

# Feature Request

## Motivation Behind Feature

<!-- Why should this feature be implemented? What problem does it solve? -->

## Feature Description

<!-- Describe the feature in detail. Include if possible, code examples, screenshots, drawback, potential breaks. -->

## Alternatives or Workarounds

<!-- List alternatives or workarounds you are currently using to support this feature in your project. -->
35 changes: 35 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# The "request-info" app is used to automatically alert users when they have created a
# new issues that does not have any description. We will reassure them that we need information
# to be able to help them. It will also say they should follow the issue template that was
# pre-provided when creating the issue.

requestInfoReplyComment: >
Thank you for your submission, however, with the lack of information, we are unable
to continue at this time.

We would appreciate it if you could provide us with more information about this
submission so that we could provide better support to this issue/pr.

Therefore, please edit this issue accordingly by using our pre-provided template or
close and create a new one and make sure to provide all the required information.

This submission will be automatically closed later if no information is provided.

# Titles can also be checked against for lack of descriptiveness. (MUST BE ALL LOWERCASE)
# requestInfoDefaultTitles:
# - update readme.md
# - updates

# Append the info-needed label issues and prs with insufficient information.
requestInfoLabelToAdd: info-needed

# Issues and PR requires more information than what is provided in the templates
# This check will will fail if the body matches the provided template
checkIssueTemplate: true
checkPullRequestTemplate: true

# Only warn about insufficient information on these events types
# Keys must be lowercase. Valid values are 'issue' and 'pullRequest'
requestInfoOn:
pullRequest: true
issue: true
35 changes: 18 additions & 17 deletions .github/lock.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Configuration for lock-threads - https://github.com/dessant/lock-threads
# The "lock" app is used to lock the threads of a closed issues or prs after (x) number of days of inactivity.
# This is to help prevent long-lived issues and prs after being resolved. If users still have issues after
# a closed PR or issue thread is locked, they should create a new issue. The locking of the thread does not
# occur immedatly after an issue or PR is closed. Users will still have an opportunity to re-open the issue.
# They can always back-link to an old locked issue in a new issue if they believe it is the one and the same.

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

# Issues and pull requests with these labels will not be locked. Set to `[]` to disable
# Skip issues and prs created before a given timestamp. ISO 8601 Timestamp `YYYY-MM-DD` or `false` to disable
skipCreatedBefore: false

# Issues and pr with these labels will be ignored. `[]` to disable
exemptLabels: []

# Label to add before locking, such as `outdated`. Set to `false` to disable
# The label to add before locking. `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
lockComment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

# pulls:
# daysUntilLock: 30
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: true
Loading