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

Android doesn't support discovery with multiple UUIDs.

Open Kuchitama opened this issue 7 years ago • 0 comments

discovery-android is not support multiple UUIDs. I got this error.

ReactNativeDiscovery.setShoudAdvertise got 2 arguments, expected 1

My code is below.

Discovery.setShouldAdvertise(myUUID, true);
Discovery.setShouldDiscover(myUUID, true);

Work around:

I modified android/src/main/java/com/joshblour/reactnativediscovery/ReactNativeDiscoveryModule.java like below.

https://github.com/yonahforst/react-native-discovery/blob/master/android/src/main/java/com/joshblour/reactnativediscovery/ReactNativeDiscoveryModule.java#L138-L149

    /**
     * Changing these properties will start/stop advertising/discovery
     */
    @ReactMethod
    public void setShouldAdvertise(String _uuid, Boolean shouldAdvertise) {
        mDiscovery.setShouldAdvertise(shouldAdvertise);
    }

    @ReactMethod
    public void setShouldDiscover(String _uuid, Boolean shouldDiscover) {
        mDiscovery.setShouldDiscover(shouldDiscover);
    }

Kuchitama avatar Dec 08 '17 17:12 Kuchitama