Giter Site home page Giter Site logo

adityapratap12 / network_info_plus_apple_tv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from epam-cross-platform-lab/network_info_plus_apple_tv

0.0 0.0 0.0 238 KB

Network info plus with AppleTV support

License: BSD 3-Clause "New" or "Revised" License

Ruby 3.64% C++ 28.67% C 1.31% Objective-C 9.81% Java 6.25% Dart 32.60% Swift 2.06% HTML 1.45% CMake 14.21%

network_info_plus_apple_tv's Introduction

network_info_plus_apple_tv

[Flutter Community: network_info_plus_apple_tv

build

This plugin allows Flutter apps to discover network info and configure themselves accordingly.

Platform Support

Android iOS MacOS Web Linux Windows
✔️ ✔️ ✔️ ✔️ ✔️

The functionality is not supported on Web.

Usage

You can get wi-fi related information using:

import 'package:network_info_plus_apple_tv/network_info_plus_apple_tv.dart';

final info = NetworkInfo();

var wifiBSSID = await info.getWifiBSSID(); // 11:22:33:44:55:66
var wifiIP = await info.getWifiIP(); // 192.168.1.1
var wifiName = await info.getWifiName(); // FooNetwork

Android

To successfully get WiFi Name or Wi-Fi BSSID starting with Android O, ensure all of the following conditions are met:

  • If your app is targeting Android 10 (API level 29) SDK or higher, your app needs to have the ACCESS_FINE_LOCATION permission.

  • If your app is targeting SDK lower than Android 10 (API level 29), your app needs to have the ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission.

  • Location services are enabled on the device (under Settings > Location).

This package does not provide the ACCESS_FINE_LOCATION nor the ACCESS_COARSE_LOCATION permission by default

iOS 12

To use .getWifiBSSID() and .getWifiName() on iOS >= 12, the Access WiFi information capability in XCode must be enabled. Otherwise, both methods will return null.

iOS 13

The methods .getWifiBSSID() and .getWifiName() utilize the CNCopyCurrentNetworkInfo function on iOS.

As of iOS 13, Apple announced that these APIs will no longer return valid information. An app linked against iOS 12 or earlier receives pseudo-values such as:

  • SSID: "Wi-Fi" or "WLAN" ("WLAN" will be returned for the China SKU).

  • BSSID: "00:00:00:00:00:00"

An app linked against iOS 13 or later receives null.

The CNCopyCurrentNetworkInfo will work for Apps that:

  • The app uses Core Location, and has the user’s authorization to use location information.

  • The app uses the NEHotspotConfiguration API to configure the current Wi-Fi network.

  • The app has active VPN configurations installed.

If your app falls into the last two categories, it will work as it is. If your app doesn't fall into the last two categories, and you still need to access the wifi information, you should request user's authorization to use location information.

There is a helper method provided in this plugin to request the location authorization: requestLocationServiceAuthorization. To request location authorization, make sure to add the following keys to your Info.plist file, located in <project root>/ios/Runner/Info.plist:

  • NSLocationAlwaysAndWhenInUseUsageDescription - describe why the app needs access to the user’s location information all the time (foreground and background). This is called Privacy - Location Always and When In Use Usage Description in the visual editor.
  • NSLocationWhenInUseUsageDescription - describe why the app needs access to the user’s location information when the app is running in the foreground. This is called Privacy - Location When In Use Usage Description in the visual editor.

Check out our documentation website to learn more. Plus plugins documentation

network_info_plus_apple_tv's People

Contributors

dzmitryzaitsau2 avatar fryette 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.