Git Product home page Git Product logo

recursyve / flutter_nearby_connections Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vnapnic/flutter_nearby_connections

1.0 1.0 1.0 64.89 MB

Flutter plugin support peer-to-peer connectivity and the discovery of nearby devices for Android vs IOS

Home Page: https://pub.dev/packages/flutter_nearby_connections

License: BSD 2-Clause "Simplified" License

Kotlin 33.52% Objective-C 1.22% Ruby 3.41% Swift 25.09% Dart 36.77%

flutter_nearby_connections's Introduction

flutter_nearby_connections

flutter nearby connections

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

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

Android

Nearby Connections API (Bluetooth & hotspot) Support Strategy: Strategy.P2P_CLUSTER, Strategy.P2P_STAR, Strategy.P2P_POINT_TO_POINT

Wi-Fi P2P (only wifi hotspot no internet) Support Strategy: Strategy.Wi_Fi_P2P

IOS

Multipeer Connectivity

We use the NearbyConnections API, but Flutter methods are based on the concept of Multipeer Connectivity IOS.

Methods provided:

startAdvertisingPeer, startBrowsingForPeers, stopAdvertisingPeer

We separate the dependencies of the MCNearbyServiceAdvertiser, MCNearbyServiceBrowser and MCSession classes. All of the methods will be implemented in the NearbyService class.

Noted

  • Android doesn't support emulator only support real devices
  • On iOS 14, need to define in Info.plist
    <key>NSBonjourServices</key>
    <array>
        <string>_{YOUR_SERVICE_TYPE}._tcp</string>
    </array>
    <key>UIRequiresPersistentWiFi</key>
    <true/>
    <key>NSBluetoothAlwaysUsageDescription</key>
    <string>{YOUR_DESCRIPTION}</string>

in this case, YOUR_SERVICE_TYPE is 'mp-connection' (you can define it)

nearbyService.init(
        serviceType: 'mp-connection',
        strategy: Strategy.P2P_CLUSTER,

Test on IOS device

The example app running in IOS

Test on Android device

The example app running in Android

Visitors Count

Loading

flutter_nearby_connections's People

Contributors

vnapnic avatar vietdq2701 avatar gabrielbdry avatar jtplouffe avatar cor277 avatar harrynguyen-vmo avatar

Stargazers

Anıl avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.