Skip to content

Commit 53b9059

Browse files
Merge pull request #46 from leandrosimoes/feature/add-support-to-rn-69
Feature/add support to rn 69
2 parents b7911c6 + ac76eb3 commit 53b9059

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2875
-3662
lines changed

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: leandrosimoes
2+
custom: ["https://www.buymeacoffee.com/leandrosimoes", lesimoes.dev]

.github/workflows/npmpublish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ jobs:
88
publish-npm:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v1
12-
- uses: actions/setup-node@v1
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
1313
with:
14-
node-version: 12
14+
node-version: '16.x'
1515
registry-url: https://registry.npmjs.org/
16-
- run: npm ci
16+
- run: yarn install --frozen-lockfile
1717
working-directory: package
18-
- run: npm publish
18+
- run: yarn lint
19+
working-directory: package
20+
- run: yarn publish
1921
working-directory: package
2022
env:
2123
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

CHANGELOG.md

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Changelog
2+
3+
## v5.0.0
4+
5+
### Fixes
6+
7+
* Error on build in RN 0.69+
8+
* Closes https://github.com/leandrosimoes/react-native-android-notification-listener/issues/44
9+
10+
### Enhancements
11+
12+
* Example project now uses RN 0.69.0
13+
14+
## v4.1.0
15+
16+
### Fixes
17+
18+
* New RN version compiling exceptions
19+
- Closes https://github.com/leandrosimoes/react-native-android-notification-listener/issues/42
20+
21+
### Changes
22+
23+
* Example project RN dependency updated to 0.68.1
24+
25+
### Breaking changes
26+
27+
* RN peer dependency updated to 0.68.1
28+
* Gradle version must be greater than or equal 7.0.0
29+
30+
## v4.0.2
31+
32+
### Fixes
33+
34+
* Fix Gradle 7.0 breaking changes
35+
36+
## v4.0.1
37+
38+
### Fixes
39+
40+
* Fixed missing README on npm
41+
42+
### Enhancements
43+
44+
* Linting improvements
45+
* Now example project also is written in typescript
46+
47+
## v4.0.0
48+
49+
### Enhancements
50+
51+
* Improved project folders structure
52+
* 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
53+
54+
### Breaking Changes
55+
56+
* RN peer dependency updated to 0.65.1
57+
* Also updated example project RN's version
58+
59+
## v3.1.2
60+
61+
### Fixes
62+
63+
* The extra key `EXTRA_SMALL_ICON` is deprecated and because of that was unable to build the project so this key was removed.
64+
65+
### Enhancements
66+
67+
* Added support for large icon
68+
- This feature closes https://github.com/leandrosimoes/react-native-android-notification-listener/issues/21
69+
70+
### Thanks for helping
71+
72+
@arunahuja94
73+
74+
## v3.1.1
75+
76+
### Fixes
77+
78+
* Fixed `groupedMessages` being passed always empty to the notification listener
79+
80+
### Thanks for helping
81+
82+
@arunahuja94
83+
84+
## v3.1.0
85+
86+
### Enhancements
87+
88+
* Add `time`, `icon`, and `image` properties to the notification payload
89+
- NOTE 1: The `image` may not work for some apps such as Telegram and WhatsApp
90+
- NOTE 2: The `icon` and `image` is passed as base64 string
91+
92+
## v3.0.0
93+
94+
### Enhancements
95+
96+
* 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).
97+
98+
### Breaking Changes
99+
100+
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).
101+
102+
### Thanks for helping
103+
104+
@arunahuja94
105+
106+
## v2.0.0
107+
108+
### Enhancements
109+
110+
* Add Headless JS service to avoid the notification listener to be killed by Android
111+
* Add Boot Up Receiver to restart the service in case the user reboots the device as soon the OS restart
112+
* Add index.d.ts to provide some typings
113+
114+
### Breaking changes
115+
116+
* 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))
117+
118+
### Thanks for helping
119+
120+
@jehartzog
121+
122+
## v1.0.4
123+
124+
### Fixes
125+
126+
* Fixed some java syntax error about missing comma
127+
* Fixed crashing application on Android 8+
128+
- Closes https://github.com/leandrosimoes/react-native-android-notification-listener/issues/1
129+
130+
### Thanks for helping
131+
132+
@qsdamar
133+
134+
## v1.0.3
135+
136+
### Fixes
137+
138+
* Fix crashing application on receiving notification
139+
140+
## v1.0.2
141+
142+
### Enhancements
143+
144+
* Add publishing with GitHub Actions
145+
146+
## v1.0.0
147+
148+
* First version

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at <opensource-conduct@fb.com>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1,
71+
available at https://www.contributor-covenant.org/version/2/1/code_of_conduct/
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Contributing to React Native Android Notification Listener
2+
3+
Thank you for your interest in contributing to React Native Android Notification Listener! See bellow how you can contribute with this project:
4+
5+
## Issues
6+
7+
All issues are valid since follow this simple rules:
8+
9+
1) Check if there's any other issue open or close that matches your need/problem before open;
10+
2) Always follow the issue templates provided on open a new issue and answer the questions carefully;
11+
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;
12+
4) Be kind with everyone;
13+
14+
## Pull Requests
15+
16+
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.
17+
18+
1) The codes follow all the code standards. You can execute `yarn lint` to check if is everything fine before send your PR;
19+
2) You code was properly tested in real devices and everything works fine;
20+
3) You PR was reviewed and approved by the repository maintainers;
21+
22+
## Donating
23+
24+
If this repository helped you in any aspect, consider to send a donation to the repository owner:
25+
26+
* [GitHub Sponsor Page](https://github.com/sponsors/leandrosimoes)
27+
* [Buy Me A Coffee](https://www.buymeacoffee.com/leandrosimoes)
28+
* [More Info](https://lesimoes.dev)

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ React Native Android Notification Listener is a library that allows you to liste
88

99
## Installation
1010

11-
`$ npm install react-native-android-notification-listener`
11+
* For React Native greater or equal then 0.68.0
12+
- `$ yarn add react-native-android-notification-listener`
13+
* For React Native between 0.65.1 and 0.67.4
14+
- `$ yarn add react-native-android-notification-listener@4.0.2`
15+
* For React Native less then 0.65
16+
- `$ yarn add react-native-android-notification-listener@3.1.2`
1217

1318
## Usage
1419

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

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

86-
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.
91+
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.
8792
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).
8893

8994
***
9095

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

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

example/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

example/README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
# Sample project for the react-native-android-notification-listener package
22

3-
This is a sample project about the usage of the `react-native-android-notification-listener` package. (Android Only)
3+
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)
44

55
## Preparing
66

7-
First execute `npm i` at the `example/` folder
8-
9-
### React Native < 0.60
10-
11-
Execute `react-native link react-native-android-notification-listener` to link the library to you project in the `example/` folder
12-
13-
### React Native >= 0.60
14-
15-
No need to do anything else, the libraries are linked automatically
7+
First of all, execute `yarn install` at the `example/` folder
168

179
## Running
1810

19-
Execute `npm start` in the `example/` folder
11+
Execute `yarn start` in the `example/` folder
2012

2113
## What else?
2214

0 commit comments

Comments
 (0)