搜索插件、代码仓与 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

所属分类

源码仓库

使用此插件的项目

暂无相关数据。