react-native-discovery
react-native-discovery copied to clipboard
Android doesn't support discovery with multiple UUIDs.
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);
}