GitHub रिपॉज़िटरीsmew-tech/flutter_nearby_connections

flutter_nearby_connections

Android और iOS के लिए Flutter प्लगइन पीयर-टू-पीयर कनेक्टिविटी और पास के उपकरणों की खोज का समर्थन करता है

flutter_nearby_connections प्रोजेक्ट कवर
स्टार
133
फ़ोर्क
100
अंतिम पुश (UTC)
15 जून 2024
प्रोजेक्ट स्थिति
सक्रिय

मूल README

यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।

flutter_nearby_connections

flutter nearby connections

Plugin: https://pub.dev/packages/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
SMEW GitHub avatar
GitHub लेखक

SMEW ↗

Founder SMEW Technology

भाषाएँDartKotlinSwiftRubyObjective-C

श्रेणियाँ

उपयोग की गई निर्भरताएँ

निर्भरता सूची 2 आइटम

  • flutter{"sdk":"flutter"}
  • flutter_testडेवलपमेंट{"sdk":"flutter"}

अपने प्रोजेक्ट के लिए रिपॉज़िटरी कैसे चुनें?

उपयोग के अनुसार छाँटें, गतिविधि की तुलना करें और अपनाने से पहले मूल प्रोजेक्ट की आवश्यकताएँ जाँचें।

  1. नाम, लेखक या विवरण से खोजें और तकनीकी विषय से परिणाम सीमित करें।
  2. स्टार, फ़ोर्क और हाल के पुश की तुलना करें। स्टार रुचि दर्शाते हैं, गुणवत्ता की गारंटी नहीं।
  3. उपयोग से पहले GitHub पर README, लाइसेंस और Issues जाँचें।

स्रोत और रखरखाव

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗