Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update native-modules-android.md #2791

Merged
merged 6 commits into from
Oct 5, 2021
Merged

Update native-modules-android.md #2791

merged 6 commits into from
Oct 5, 2021

Conversation

simonbrunou
Copy link
Contributor

Those two methods are missing in the documentation and an exception is sent if they are not in the code.

@facebook-github-bot
Copy link

Hi @simonbrunou!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@netlify
Copy link

netlify bot commented Sep 24, 2021

✔️ Deploy Preview for react-native ready!

🔨 Explore the source changes: 8cd30cc

🔍 Inspect the deploy log: https://app.netlify.com/sites/react-native/deploys/615c74708fc8ef0007dc1588

😎 Browse the preview: https://deploy-preview-2791--react-native.netlify.app

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

1 similar comment
@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

@satya164 satya164 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you post what exception you got and share a link to the native module which implemented this?

@simonbrunou
Copy link
Contributor Author

When omitting addListener, this is the exception:

`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.

When omitting removeListeners, this is the exception:

`new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.

I cannot share a link to the native module which implemented this when I was confronted with the problem as it is proprietary source code. However I can put together a file that implements it quickly, if needed.

@facebook-github-bot facebook-github-bot added the Shared with React Native Team Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Sep 29, 2021
@rubennorte
Copy link

Thanks @simonbrunou for improving our docs! This was definitely incomplete without the examples that you added. Can you please address my comment so we can merge it? Thanks!

@simonbrunou
Copy link
Contributor Author

Thanks @simonbrunou for improving our docs! This was definitely incomplete without the examples that you added. Can you please address my comment so we can merge it? Thanks!

I think it's done, however I'm not familiar with GitHub's interface so correct me if I did something wrong.

Copy link
Collaborator

@Simek Simek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @simonbrunou, thank you for bringing this topic up! 👍

Since the change landed in 0.65 release (facebook/react-native@114be1d), please update also versioned docs for 0.65 and 0.66 besides the next file:

@simonbengtsson

This comment has been minimized.

@Simek

This comment has been minimized.

@simonbengtsson

This comment has been minimized.

@Simek

This comment has been minimized.

simonbrunou and others added 3 commits October 5, 2021 14:36
Those two methods are missing in the documentation and an exception is sent if they are not in the code.
@simonbrunou
Copy link
Contributor Author

I rebased on main and added the changes to the documentation.

@simonbrunou simonbrunou requested a review from Simek October 5, 2021 13:54
Copy link
Collaborator

@Simek Simek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you did not force push after rebase, which leads to malformed PR, please fix that. 😉

@simonbrunou simonbrunou requested a review from Simek October 5, 2021 15:09
@simonbrunou
Copy link
Contributor Author

It should be good now.

Copy link
Collaborator

@Simek Simek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates! 👍

From the technical standpoint it LGTM, but let's wait with the merge for the @rubennorte approval on the wording/description changes. 🙂

@rubennorte
Copy link

I think we can still improve the comment. I don't think the current one is useful to tell people what this is for, only that's required. We could say something like what we say on iOS.

So instead of:

 // Keep: Required for RN built in Event Emitter Calls.

We could use something like:

@ReactMethod
public void addListener(String eventName) {
  // Set up any upstream listeners or background tasks as necessary
}

@ReactMethod
public void removeListeners(Integer count) {
  // Remove upstream listeners, stop unnecessary background tasks
}

@simonbrunou could you please make these changes? Sorry for the back and forth.

@simonbrunou
Copy link
Contributor Author

Updated the files 👍

@rubennorte rubennorte merged commit 5949fae into facebook:main Oct 5, 2021
@rubennorte
Copy link

Thanks for improving our website, @simonbrunou!

sunnylqm added a commit to reactnativecn/react-native-website that referenced this pull request Oct 9, 2021
* Add a note about where to place the Gradle vars (facebook#2776)


Co-authored-by: Gijs Weterings <me@gijsweterings.nl>

* Update appstate.md (facebook#2778)


Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>

* Animations: remove unused style object (facebook#2780)

* Force `trim@^1.0.1` resolution (facebook#2782)

* Bump axios from 0.21.1 to 0.21.4 (facebook#2783)

Bumps [axios](https://github.com/axios/axios) from 0.21.1 to 0.21.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](axios/axios@v0.21.1...v0.21.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add help relating to Android intent queries (facebook#2774)

* Add help relating to Android intent queries

On Android 11 in order for `Linking.canOpenUrl` to return `true` the scheme/intent must be specified in AndroidManifest.xml and queryable. This is not currently clear in the documentation even though specific instructions are given for iOS.

* Tweaks from prettier linting.

* Fix spelling mistakes.

Co-authored-by: Gijs Weterings <me@gijsweterings.nl>

* Ensure AndroidManifest.xml example matches the descriptive text.

Co-authored-by: Gijs Weterings <me@gijsweterings.nl>

* Improve wording in the description for the example code.

Co-authored-by: Gijs Weterings <me@gijsweterings.nl>

* Split sentence in two to improve readability

Co-authored-by: Gijs Weterings <me@gijsweterings.nl>

Co-authored-by: Gijs Weterings <me@gijsweterings.nl>

* docs: add fragment to native-components-android.md (facebook#2599)

* docs: add fragment to native-components-android.md

As a Javascript / React-Native developer I had a hard time figuring out how to integrate a custom native SDK to React Native with the help of Android Fragments. Please correct anything that you wish. This information took me 3 days to figure out, especially the part with `setupLayout` and `manuallyLayoutChildren` so I wish an example like this was available in the official documentation. I was expecting the code without `setupLayout` and `manuallyLayoutChildren` but i had no luck. If somebody has any better solution in your team, or any explanation, it would also be really nice to state in the documentation

* chore: fix linting errors

* chore: fix alex errors

* docs: update native-components-android.md

* docs: update native-components-android.md

- add missing imports
- remove extra spaces
- remove unnecessary double cast
- remove unnecessary comment

* Bump semver-regex from 3.1.2 to 3.1.3 (facebook#2788)

Bumps [semver-regex](https://github.com/sindresorhus/semver-regex) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/sindresorhus/semver-regex/releases)
- [Commits](https://github.com/sindresorhus/semver-regex/commits)

---
updated-dependencies:
- dependency-name: semver-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump prismjs from 1.24.0 to 1.25.0 (facebook#2787)

Bumps [prismjs](https://github.com/PrismJS/prism) from 1.24.0 to 1.25.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](PrismJS/prism@v1.24.0...v1.25.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Remove the link to 2021 React Community Survey (facebook#2784)

* Bump ansi-regex to ^5.0.1 to fix CVE-2021-3807 (facebook#2794)

* Release 0.66 Post (facebook#2797)

* Add post and assets

* Fix lint

* Update links and image

* Ignore alex warning

* Fix linking for highlights

* Capitalize Bluetooth and align titles

* Capitalize Bluetooth and align titles

* Missed one Bluetooth

* Credit mikehardy

* Cut 0.66 docs (facebook#2798)

* update link troubleshooting (facebook#2799)

* Update handling-text-input.md (facebook#2795)

* Update tsconfig.json example (facebook#2796)

* fix preview deploy failure due to links in older blog posts (facebook#2803)

* add section of `stickyHeaderHiddenOnScroll` option (facebook#2801)

* Update native-modules-android.md (facebook#2791)

* Update native-modules-android.md

Those two methods are missing in the documentation and an exception is sent if they are not in the code.

Co-authored-by: Simon BRUNOU <simon.brunou@bystamp.com>

* Update linking.md (facebook#2802)

* [Docs] Add an asterisk note to the hermes bundle is in use (facebook#2804)

Co-authored-by: Raquel Smith <raquelmsmith@users.noreply.github.com>
Co-authored-by: Gijs Weterings <me@gijsweterings.nl>
Co-authored-by: Luis Durão <luis.p.durao@gmail.com>
Co-authored-by: Bartosz Kaszubowski <gosimek@gmail.com>
Co-authored-by: Titus Efferian <kiritosato@gmail.com>
Co-authored-by: Timothy Yung <yungsters@fb.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Leonard <mike.r.leonard@gmail.com>
Co-authored-by: Fazekas Dániel <daniel.tamas.fazekas@gmail.com>
Co-authored-by: Ivan Moskalev <ivan.moskalev@gmail.com>
Co-authored-by: Nicola Corti <corti.nico@gmail.com>
Co-authored-by: Luna <luwe@fb.com>
Co-authored-by: Luis Medina Huerta <luism3861@gmail.com>
Co-authored-by: Nana Asiedu-Ampem <nanaasiedu0@gmail.com>
Co-authored-by: David NRB <4661784+retyui@users.noreply.github.com>
Co-authored-by: guruguru-dekiruko <40130327+grgr-dkrk@users.noreply.github.com>
Co-authored-by: Simon <5848809+simonbrunou@users.noreply.github.com>
Co-authored-by: Simon BRUNOU <simon.brunou@bystamp.com>
Co-authored-by: Jens Kuhr Jørgensen <jenskuhr4@gmail.com>
Co-authored-by: limaAniceto <lima.aniceto@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Needs: React Native Team Attention Shared with React Native Team Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants