BREAKING CHANGE: Update API for connection, communication channel state and is browser value (#14)
* refactor(lib, example, example_full): use streams for communication channel and is ios browser * feat: add abstract toJson() to message * refactor: add deprecations for nearby_service * feat(example): update main.dart * feat(nearby_service): add comments * feat(nearby_service_platform_interface): add deprecation to getConnectedDeviceStream * feat(nearby_service/message): add concrete implementation for toJson() * feat(nearby_service/android): add deprecations * fix(nearby_service/android): reset check for android device * fix(nearby_service/ios): change ios service to deprecations variant * chore(nearby_service): edit deprecation messages * chore: update gitignore * doc: add CONTRIBUTING file * doc: update CONTRIBUTING file * chore: update CONTRIBUTING.md * chore: update CONTRIBUTING.md * chore: version 0.1.0 * fix(example_full): move startListeningCommunicationChannelState() upper
This commit is contained in:
@@ -54,13 +54,17 @@ class MethodChannelNearbyService extends NearbyServicePlatform {
|
||||
}
|
||||
|
||||
@override
|
||||
@Deprecated('Use getConnectedDeviceStreamById instead')
|
||||
Stream<NearbyDevice?> getConnectedDeviceStream(NearbyDevice device) {
|
||||
return getConnectedDeviceStreamById(device.info.id);
|
||||
}
|
||||
|
||||
@override
|
||||
Stream<NearbyDevice?> getConnectedDeviceStreamById(String deviceId) {
|
||||
const connectedDeviceChannel = EventChannel(
|
||||
"nearby_service_connected_device",
|
||||
);
|
||||
return connectedDeviceChannel
|
||||
.receiveBroadcastStream(device.info.id)
|
||||
.map((e) {
|
||||
return connectedDeviceChannel.receiveBroadcastStream(deviceId).map((e) {
|
||||
final updatedResult = ResultHandler.instance.handle(e);
|
||||
return NearbyDeviceMapper.instance.mapToDevice(updatedResult);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user