Skip to content

Commit

Permalink
Merge pull request #46 from leandrosimoes/feature/add-support-to-rn-69
Browse files Browse the repository at this point in the history
Feature/add support to rn 69
  • Loading branch information
leandrosimoes authored Jun 25, 2022
2 parents b7911c6 + ac76eb3 commit 53b9059
Show file tree
Hide file tree
Showing 55 changed files with 2,875 additions and 3,662 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: leandrosimoes
custom: ["https://www.buymeacoffee.com/leandrosimoes", lesimoes.dev]
12 changes: 7 additions & 5 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 12
node-version: '16.x'
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: yarn install --frozen-lockfile
working-directory: package
- run: npm publish
- run: yarn lint
working-directory: package
- run: yarn publish
working-directory: package
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
148 changes: 148 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# Changelog

## v5.0.0

### Fixes

* Error on build in RN 0.69+
* Closes https://github.com/leandrosimoes/react-native-android-notification-listener/issues/44

### Enhancements

* Example project now uses RN 0.69.0

## v4.1.0

### Fixes

* New RN version compiling exceptions
- Closes https://github.com/leandrosimoes/react-native-android-notification-listener/issues/42

### Changes

* Example project RN dependency updated to 0.68.1

### Breaking changes

* RN peer dependency updated to 0.68.1
* Gradle version must be greater than or equal 7.0.0

## v4.0.2

### Fixes

* Fix Gradle 7.0 breaking changes

## v4.0.1

### Fixes

* Fixed missing README on npm

### Enhancements

* Linting improvements
* Now example project also is written in typescript

## v4.0.0

### Enhancements

* Improved project folders structure
* Now the example project has a prepare.js file used to set up the project for testing. Just follow [this](https://github.com/leandrosimoes/react-native-android-notification-listener/blob/master/example/README.md) instructions

### Breaking Changes

* RN peer dependency updated to 0.65.1
* Also updated example project RN's version

## v3.1.2

### Fixes

* The extra key `EXTRA_SMALL_ICON` is deprecated and because of that was unable to build the project so this key was removed.

### Enhancements

* Added support for large icon
- This feature closes https://github.com/leandrosimoes/react-native-android-notification-listener/issues/21

### Thanks for helping

@arunahuja94

## v3.1.1

### Fixes

* Fixed `groupedMessages` being passed always empty to the notification listener

### Thanks for helping

@arunahuja94

## v3.1.0

### Enhancements

* Add `time`, `icon`, and `image` properties to the notification payload
- NOTE 1: The `image` may not work for some apps such as Telegram and WhatsApp
- NOTE 2: The `icon` and `image` is passed as base64 string

## v3.0.0

### Enhancements

* Add more properties to the notification payload. You can see all of them in the documentation [here](https://github.com/leandrosimoes/react-native-android-notification-listener).

### Breaking Changes

Now the notification received by the handler function was changed to a JSON string payload so before using you must do `JSON.parse`. You can see more in the documentation [here](https://github.com/leandrosimoes/react-native-android-notification-listener).

### Thanks for helping

@arunahuja94

## v2.0.0

### Enhancements

* Add Headless JS service to avoid the notification listener to be killed by Android
* Add Boot Up Receiver to restart the service in case the user reboots the device as soon the OS restart
* Add index.d.ts to provide some typings

### Breaking changes

* Removed the method `onNotificationReceived` because now the handle must be made using the `AppRegistry`. (See the documentation [here](https://github.com/leandrosimoes/react-native-android-notification-listener))

### Thanks for helping

@jehartzog

## v1.0.4

### Fixes

* Fixed some java syntax error about missing comma
* Fixed crashing application on Android 8+
- Closes https://github.com/leandrosimoes/react-native-android-notification-listener/issues/1

### Thanks for helping

@qsdamar

## v1.0.3

### Fixes

* Fix crashing application on receiving notification

## v1.0.2

### Enhancements

* Add publishing with GitHub Actions

## v1.0.0

* First version
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <[email protected]>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1,
available at https://www.contributor-covenant.org/version/2/1/code_of_conduct/

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contributing to React Native Android Notification Listener

Thank you for your interest in contributing to React Native Android Notification Listener! See bellow how you can contribute with this project:

## Issues

All issues are valid since follow this simple rules:

1) Check if there's any other issue open or close that matches your need/problem before open;
2) Always follow the issue templates provided on open a new issue and answer the questions carefully;
3) Always help to find the a solution. Don't be that guy that opens an issue and waits for the solution to come from others;
4) Be kind with everyone;

## Pull Requests

Fell free to open a PR with your modifications, but keep in mind that it will be merged only if all the following rules are properly applied.

1) The codes follow all the code standards. You can execute `yarn lint` to check if is everything fine before send your PR;
2) You code was properly tested in real devices and everything works fine;
3) You PR was reviewed and approved by the repository maintainers;

## Donating

If this repository helped you in any aspect, consider to send a donation to the repository owner:

* [GitHub Sponsor Page](https://github.com/sponsors/leandrosimoes)
* [Buy Me A Coffee](https://www.buymeacoffee.com/leandrosimoes)
* [More Info](https://lesimoes.dev)
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ React Native Android Notification Listener is a library that allows you to liste

## Installation

`$ npm install react-native-android-notification-listener`
* For React Native greater or equal then 0.68.0
- `$ yarn add react-native-android-notification-listener`
* For React Native between 0.65.1 and 0.67.4
- `$ yarn add [email protected]`
* For React Native less then 0.65
- `$ yarn add [email protected]`

## Usage

Expand Down Expand Up @@ -83,12 +88,12 @@ For more details, see the `example/` project in this repository

"There are some limitations regarding the use of the Headless JS by this module that I should care about?"

Yes, there are some nuances that you should concern. For example, since Headless JS runs in a standalone "Task" you can't interact directly with it by the touch UI.
Yes, there are some nuances that you should concern about. For example, since Headless JS runs in a standalone "Task" you can't interact directly with it by the touch UI.
For more information about using Headless JS in React Native, I suggest you take a look at the official documentation [here](https://reactnative.dev/docs/headless-js-android).

***

"I keep receiving the warning `registerHeadlessTask or registerCancellableHeadlessTask called multiple times for same key '${taskKey}'`, is that a problem?
"I keep receiving the warning `registerHeadlessTask or registerCancellableHeadlessTask called multiple times for the same key '${taskKey}'`, is that a problem?

No, this warning is here, where you can see that the task providers are stored in a set, and there's no way to delete them, so react is just complaining about the fact that we are overwriting it.

Expand Down
2 changes: 2 additions & 0 deletions example/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
14 changes: 3 additions & 11 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
# Sample project for the react-native-android-notification-listener package

This is a sample project about the usage of the `react-native-android-notification-listener` package. (Android Only)
This is a sample project about the usage of the `react-native-android-notification-listener` package in a 0.69 React Native application. (Android Only)

## Preparing

First execute `npm i` at the `example/` folder

### React Native < 0.60

Execute `react-native link react-native-android-notification-listener` to link the library to you project in the `example/` folder

### React Native >= 0.60

No need to do anything else, the libraries are linked automatically
First of all, execute `yarn install` at the `example/` folder

## Running

Execute `npm start` in the `example/` folder
Execute `yarn start` in the `example/` folder

## What else?

Expand Down
Loading

0 comments on commit 53b9059

Please sign in to comment.