react-native-sound icon indicating copy to clipboard operation
react-native-sound copied to clipboard

React Native New Architecture support Done

Open SolankiYogesh opened this issue 1 year ago • 7 comments

feat: added fabric example

fix: example testing

fix: removed unwated scripts

feat: new architecture support done

SolankiYogesh avatar Nov 12 '24 06:11 SolankiYogesh

Thank you @SolankiYogesh. I don't currently have time to review & test. If anyone can review it? :)

RomualdPercereau avatar Nov 25 '24 09:11 RomualdPercereau

Thanks @SolankiYogesh ! Do you use this in production at the moment?

These methods are missing for Android.

@ReactMethod
 public void enable(final Boolean enabled) {
   // no op
 }

 @Override
 public Map<String, Object> getConstants() {
   final Map<String, Object> constants = new HashMap<>();
   constants.put("IsAndroid", true);
   return constants;
 }

enable seems to be just a stub, getConstants might cause some regression for some devs

For iOS while there's enableInSilenceMode method, enable is missing.

enable vs enableInSilenceMode - these serve different purposes in iOS:

  • enable: Uses AVAudioSessionCategoryAmbient - sound is muted when phone is in silent mode
  • enableInSilenceMode: Uses AVAudioSessionCategoryPlayback - sound plays even in silent mode

@RomualdPercereau maybe let's consider releasing alpha version with the new arch and ask devs to test it with us. I'll try to run some tests as well

Okelm avatar Nov 26 '24 10:11 Okelm

@Okelm i think both methods are not required because. enable is for IOS only and for IsAndroid i am directly using Platfrom.OS

ok let me check again all code and yes i am currently using this patch in my product app

SolankiYogesh avatar Nov 26 '24 10:11 SolankiYogesh

ok yes enable method is missing let me add

` RCT_EXPORT_METHOD(enable : (BOOL)enabled) { AVAudioSession *session = [AVAudioSession sharedInstance]; [session setCategory:AVAudioSessionCategoryAmbient error:nil]; [session setActive:enabled error:nil]; }

`

SolankiYogesh avatar Nov 26 '24 10:11 SolankiYogesh

As long as there's no plan to ditch Windows support this will require Windows new arch rewrite as well.

Okelm avatar Nov 26 '24 19:11 Okelm

@SolankiYogesh do you want to add windows support?

Okelm avatar Jan 14 '25 09:01 Okelm

Yes currently i am checking how to apply new arch support in mac os and windows so i will update patch again with windows changes

SolankiYogesh avatar Jan 14 '25 09:01 SolankiYogesh

@SolankiYogesh is your investigation still ongoing? These changes not being merged are preventing newer react-native projects from making use of this library.

farkerhaiku avatar Apr 01 '25 20:04 farkerhaiku

Anxiously awaiting this.

dcorbin avatar Apr 14 '25 16:04 dcorbin