Skip to content

Commit

Permalink
Merge branch 'master' of github.com:VNAPNIC/flutter_nearby_connections
Browse files Browse the repository at this point in the history
  • Loading branch information
vietdq2701 committed Nov 25, 2020
2 parents 1b6f6d5 + 11bc1b5 commit 76e285c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 10 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 1.0.7

* update readme

## 1.0.6

* remove deviceID, fix connect Android

## 1.0.5

* remove deviceID, fix connect IOS

## 1.0.4

* Fix Android connected unstable
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ flutter nearby connections
#### Plugin: [https://pub.dev/packages/flutter_nearby_connections](https://pub.dev/packages/flutter_nearby_connections)

### Flutter plugin supports peer-to-peer connectivity and discovers nearby devices for Android and IOS

#### Android doesn't support emulator only support real devices

The flutter_nearby_connections plugin supports the discovery of services provided by nearby devices.
Moreover, the flutter_nearby_connections plugin also supports communicating with those services through message-based data, streaming data, and resources (such as files). The framework uses infrastructure Wi-Fi networks, peer-to-peer Wi-Fi and Bluetooth Personal Area Networks (PAN) for the underlying transport over UDP.
The project is based on [Nearby Connections API](https://developers.google.com/nearby/connections/overview) and [Multipeer Connectivity](https://developer.apple.com/documentation/multipeerconnectivity).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ class FlutterNearbyConnectionsPlugin : FlutterPlugin, MethodCallHandler, Activit
private lateinit var callbackUtils: CallbackUtils
private var mService: NearbyService? = null

private lateinit var localDeviceId: String
private lateinit var localDeviceName: String
private lateinit var strategy: Strategy
private lateinit var connectionsClient: ConnectionsClient
Expand Down Expand Up @@ -85,7 +84,6 @@ class FlutterNearbyConnectionsPlugin : FlutterPlugin, MethodCallHandler, Activit
val intent = Intent(activity, NearbyService::class.java)
activity.bindService(intent, connection, Context.BIND_AUTO_CREATE)

localDeviceId = call.argument<String>("deviceId")!!
localDeviceName = if (call.argument<String>("deviceName").isNullOrEmpty())
Build.MANUFACTURER + " " + Build.MODEL
else
Expand Down
6 changes: 0 additions & 6 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'dart:io';
import 'package:device_info/device_info.dart';
import 'package:flutter/material.dart';
import 'package:flutter_nearby_connections/flutter_nearby_connections.dart';
import 'package:flutter_udid/flutter_udid.dart';
import 'package:fluttertoast/fluttertoast.dart';

void main() {
Expand Down Expand Up @@ -106,10 +105,6 @@ Future<String> _getId() async {
}
}

Future<String> _getDeviceID() async {
return await FlutterUdid.udid;
}

class _DevicesListScreenState extends State<DevicesListScreen> {
List<Device> devices = [];
List<Device> connectedDevices = [];
Expand Down Expand Up @@ -299,7 +294,6 @@ class _DevicesListScreenState extends State<DevicesListScreen> {
}

void init() async {
String deviceId = await _getId();
nearbyService = NearbyService();
await nearbyService.init(
serviceType: 'mp-connection',
Expand Down
3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: flutter_nearby_connections
description: Flutter plugin supports peer-to-peer connectivity and discovers nearby devices for Android and IOS
version: 1.0.4
version: 1.0.7
author: [email protected]
homepage: https://github.com/VNAPNIC/flutter_nearby_connections

Expand All @@ -13,7 +13,6 @@ dependencies:
sdk: flutter
pedantic: ^1.9.0
fluttertoast: ^7.1.1
flutter_udid: ^1.0.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 76e285c

Please sign in to comment.