搜尋套件、儲存庫與 APP 分類

套件詳情v0.0.4

device_information

一個 Flutter 插件,用於取得裝置資訊,例如裝置 IMEI 號碼、型號名稱、API 等級、CPU 類型、產品名稱等,適用於 Android 與 iOS。

AndroidiOS
近 30 天下載
369
喜歡數
112
Pub 分數
150

安裝套件

flutter pub add device_information

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

device_information 套件是 Flutter 插件,讓開發者可在 Android 與 iOS 平台上取得詳細的裝置資訊。它提供對關鍵硬體與軟體細節的存取,例如 IMEI 號碼、型號名稱、API 層級、CPU 類型與產品名稱。專為跨平台相容性設計,簡化了無需撰寫平台特定程式碼即可收集裝置特定資料的過程。適用於分析、裝置追蹤或應用個別化功能。

適用情境

  • 設備追蹤和識別
  • 使用者分析與報告
  • 基於設備規格的應用個性化
  • 故障排除和診斷
  • 許可證驗證

主要特色

  • 跨平台支援(Android 與 iOS)
  • 存取 IMEI、型號、API 層級、CPU 類型
  • 簡單的 API 結合
  • 無需原生程式碼
  • 即時設備資料檢索

適合對象

  • 開發分析工具的開發者
  • 需要設備級識別的应用程序
  • 企業或安全導向的應用程式
  • 需要設備兼容性檢查的應用程式

使用建議

  • 在較新版本的 iOS 上,IMEI 存取受到限制
  • Android 上需要正確的權限
  • 處理敏感資料需符合隱私合規要求
  • 僅限非根設備的 Android

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Device Information

A flutter plugin to get device information such as device IMEI number, model name, API level,CPU Type,Product Name etc for both android & iOS.

Installation

Add following dependency in pubspec.yaml file:

device_information:^0.0.4

Install by running:

$ flutter pub get 

Usage

import 'package:device_information/device_information.dart';

try {
      platformVersion = await DeviceInformation.platformVersion;
      imeiNo = await DeviceInformation.deviceIMEINumber;
      modelName = await DeviceInformation.deviceModel;
      manufacturer = await DeviceInformation.deviceManufacturer;
      apiLevel =  await DeviceInformation.apiLevel;
      deviceName = await DeviceInformation.deviceName;
      productName = await DeviceInformation.productName;
      cpuType = await DeviceInformation.cpuName;
      hardware = await DeviceInformation.hardware;
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

In android add the following permission:

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

Then for API targetting from Marshmallow, need to request runtime permissions. Although in iOS there is no need to specify permissions.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Developer Team:

Hina Hussain & her team members (Kamran Khan, Abdul Sattar, Faiza Farooqui) :smile: :tada:

Follow me

https://hina-hussain-developer.medium.com/creating-publisher-account-on-the-pub-dev-cf86b91cd2f https://hinahussaindev.blogspot.com/2021/05/creating-publisher-account-on-pubdev.html

License

MIT

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。