Skip to content

Android doesn't support discovery with multiple UUIDs. #11

Description

@Kuchitama

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);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions