hirbod / react-native-volume-manager

React Native module which adds the ability to change the system volume on iOS and Android, listen to volume changes and supress the native volume UI to build your own volume slider or UX. It can listen to iOS mute switch and ringer mode changes on Android (and let you set the ringer mode)
MIT License
216 stars 14 forks source link

[Android] Fix autolinking: Remove redundant package #2

Closed barthap closed 1 year ago

barthap commented 1 year ago

Why

Fixes #1

It looks like RN autolinking supports only one class implementing ReactPackage per library on Android. This library had two packages and one wasn't added to the generated com.facebook.react.PackageList in the app project.

How

Deleted the VolumeManagerSilentListenerPackage and moved the VolumeManagerSilentListenerModule initialization to VolumeManagerPackage.

Test plan

Tried this with a plain new RN app (the example app still uses manual linking):

npx crna my-app
yarn add react-native-volume-manager
# here applied the PR changes to `node_modules/react-native-volume-manager`
expo run:android
hirbod commented 1 year ago

You're the GOAT! Thank you so much!