A Cordova plugin for the Google Nearby Connections API.
Android (4.1+)
- Currently only supports sending/receiving string payloads (no file or stream support)
Cordova:
cordova plugin add cordova-plugin-google-nearby-connections
Ionic (2+):
ionic cordova plugin add cordova-plugin-google-nearby-connections
Install from GitHub:
cordova plugin add https://github.com/kspierson/cordova-plugin-google-nearby-connections
var GoogleNearbyConnections = cordova.plugins.GoogleNearbyConnections;
GoogleNearbyConnections.startAdvertising(deviceName, strategyType, serviceId, success, error);
GoogleNearbyConnections.startDiscovery(strategyType, serviceId, success, error);
GoogleNearbyConnections.onEndpointFound(success, error);
GoogleNearbyConnections.onEndpointLost(success, error);
GoogleNearbyConnections.onConnectionFound(success, error);
GoogleNearbyConnections.onConnection(success, error);
GoogleNearbyConnections.onConnectionLost(success, error);
GoogleNearbyConnections.acceptConnection(endpointId, success, error);
GoogleNearbyConnections.denyConnection(endpointId, success, error);
GoogleNearbyConnections.sendPayload(endpointId, payload, success, error);
GoogleNearbyConnections.onPayloadReceived(success, error);
Cordova
cordova plugin rm cordova-plugin-google-nearby-connections
Ionic
ionic cordova plugin rm cordova-plugin-google-nearby-connections