Skip to content

Commit

Permalink
fixed warnings 'new NativeEventEmitter() was called with a non-null a…
Browse files Browse the repository at this point in the history
…rgument without the required addListener and removeListener methods' on react-native 0.65 and android platform (#740)

Co-authored-by: lyubomyr <lubomyr31@gmailc.om>
  • Loading branch information
lubomyr and lyubomyr authored Aug 28, 2021
1 parent 62c90fb commit b52ba14
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions android/src/main/java/com/zmxv/RNSound/RNSoundModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ protected MediaPlayer createMediaPlayer(final String fileName) {
}
return mediaPlayer;
}

return null;
}

Expand Down Expand Up @@ -320,7 +320,7 @@ public void release(final Double key) {
}
}
}

@Override
public void onCatalystInstanceDestroy() {
java.util.Iterator it = this.playerPool.entrySet().iterator();
Expand Down Expand Up @@ -472,4 +472,14 @@ public Map<String, Object> getConstants() {
constants.put("IsAndroid", true);
return constants;
}

@ReactMethod
public void addListener(String eventName) {
// Keep: Required for RN built in Event Emitter Calls.
}

@ReactMethod
public void removeListeners(Integer count) {
// Keep: Required for RN built in Event Emitter Calls.
}
}

0 comments on commit b52ba14

Please sign in to comment.