Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kuchitama opened this issue Dec 8, 2017 · 0 comments
Open

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

Kuchitama opened this issue Dec 8, 2017 · 0 comments

Comments

@Kuchitama
Copy link

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);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant