1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

FlutterからWiFiアクセスポイントに接続する方法

Posted at

前提条件(iOSの場合)

https://help.apple.com/developer-account/#/dev21218dfd6
Hotspot Configurationという機能を利用しますが、上記リンクに記載されている通り、ADP又はEnterpriseを利用します。そのためAppleに毎年約1万円という学生の方(私)にとってとても痛い契約をしていない方は利用できませんのでご注意ください。

検証環境

[✓] Flutter (Channel stable, 3.0.1, on macOS 12.4 21F79 darwin-arm, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.1)
[✓] VS Code (version 1.67.2)
[✓] HTTP Host Availability

利用パッケージ

次のパッケージを利用します。(随筆時点はv0.3.16)

iOSの場合

image.png
XCodeでプロジェクトを開き、
Runner > Signing & Capabilities > Allの隣の+
を選択し、HotSpot Configurationを選択して有効にします。
image.png

コード

WiFiForIoTPlugin.connect(/*SSID*/,
    password: /*password*/,
    security: /*NetworkSecurity型のセキュリティ*/,
    joinOnce: /*1度きりの接続かどうか*/);

詳しいドキュメントはこちらからどうぞ。
https://pub.dev/documentation/wifi_iot/latest/wifi_iot/WiFiForIoTPlugin-class.html

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?