-
Notifications
You must be signed in to change notification settings - Fork 233
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
Fix warning new NativeEventEmitter() called without... #520
Open
elibroftw
wants to merge
1
commit into
ocetnik:master
Choose a base branch
from
Spltthetnk:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rgument without the required addListener and removeListener methods' on react-native 0.65 and android platform
elibroftw
changed the title
Fix warning 'new NativeEventEmitter()
Fix warning new NativeEventEmitter() called without...
Aug 5, 2023
gustavoabel
approved these changes
Sep 3, 2023
I agree with this fix. Please merge. |
Hey can someone merge this, kindly |
I used patch-package. // node_modules/react-native-background-timer/android/src/main/java/com/ocetnik/timer/BackgroundTimerModule.java
@ReactMethod
public void setTimeout(final int id, final double timeout) {
Handler handler = new Handler();
handler.postDelayed(new Runnable(){
@Override
public void run(){
if (getReactApplicationContext().hasActiveCatalystInstance()) {
getReactApplicationContext()
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit("backgroundTimer.timeout", id);
}
}
}, (long) timeout);
}
// here
@ReactMethod
public void addListener(String eventName) {
// Keep: Required for RN built in Event Emitter Calls.
}
// here
@ReactMethod
public void removeListeners(Integer count) {
// Keep: Required for RN built in Event Emitter Calls.
} npx patch-package react-native-background-timer
rm -rf node_modules
yarn install
yarn run start --reset-cache
yarn run android
yarn run ios |
hey can we merge this please? |
Agree with PR, please merge |
please merge |
Please merge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix the warning
new NativeEventEmitter() was called with a non-null argument without the required addListener and removeListener methods
Closes #359
Closes #366
Closes #367
Original patch source: https://stackoverflow.com/a/69650217/7732434
For those wanting this fix, instead of waiting for a merge, you can install the fork
yarn add react-native-background-timer@https://github.com/Spltthetnk/react-native-background-timer
Hopefully someone can fix the iOS warnings that probably exist (I'm on Windows, so I don't know).
Be sure to check out SplitTheTank (https://splitthetank.com) in the near future. 💙💜