Azure-Samples / communication-services-ui-library-react-native

UI library sample for React Native Bridge
MIT License
12 stars 13 forks source link

[Android] dismiss() not working #60

Closed valntyn closed 2 days ago

valntyn commented 1 week ago

Hi, thanks for the detailed guide and example on how to create a bridge and use native methods from the Communication Services UI library in a React Native application!

However, I encountered a problem where the @ReactMethod dismiss method does not work on Android (on any Android version and device) while I'm on a call. On iOS, everything works fine.

Versions: 'AzureCommunicationUICalling', '1.9.0' "react-native": "0.73.6",

I'm using the same code from the example on the native side.

public void dismiss() {
    if (callComposite != null) {
        callComposite.dismiss();
    }
}

If I call the following method, I can end the call, but the app may crash.

public void dismiss() {
    if (callComposite == null) {
        callComposite = new CallCompositeBuilder().build();
    }
    if (callComposite != null) {
        callComposite.dismiss();
    }
}

Here is the code example I'm using in React Native app while on a call.

import { NativeModules } from 'react-native'; const { RNAzureCommunicationUICalling } = NativeModules;

await RNAzureCommunicationUICalling.dismiss();

Please advise a solution, I’m sure the problem is most likely on my side. I can provide more information if needed.

pavelprystinka commented 2 days ago

Thanks for pointing this out @valntyn It is now fixed.