lb_discovery 1.0.0 lb_discovery: ^1.0.0 copied to clipboard
Logbot MDNS discovery service to scan and find nearby devices
Logbot Discovery SDK for Flutter #
This is a package that provides an MDNS service to scan and find nearby IoTs.
Requirements #
Dart 2.17 or later
Installation & Usage #
Add the dependencies from pub.dev:
dependencies:
lb_auth:
lb_discovery:
lb_auth
is always required to make authorized calls to the APIs.
To use the SDK on you application see the example below:
For Android, add the following properties to your Android Manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
For iOS, add the following properties to Info.plist
:
<key>NSLocalNetworkUsageDescription</key>
<string>Required to discover local network devices</string>
<key>NSBonjourServices</key>
<array>
<string>_http._tcp</string>
</array>
To use the SDK on you application see the example below:
import 'package:lb_auth/lb_auth.dart';
import 'package:lb_writer/lb_writer.dart';
class Example {
Future<void> run() async {
/// Initialize Logbot SDK by logging in with Logbot Credentials
await LogbotAuth.init(LogbotCredentials(
username: username,
password: password,
clientId: clientId,
clientSecret: clientSecret,
));
/// Now you can use every API included on the SDK
/// for example:
List<Device> response = await LogbotDiscovery.discovery.discoverLocal();
}
}
Tests #
To run all tests:
flutter test
Documentation for API Endpoints #
Class | Method | Description |
---|---|---|
DiscoveryApi | discover | Lists all devices |
DiscoveryApi | discoverDevice | Discovers where a device is available |
DiscoveryApi | discoverLocal | Discover local devices |
DiscoveryApi | discoverRemote | Lists remote devices |
Documentation For Models #
Author #
Logbot SRL info@logbot.cloud