Giter Site home page Giter Site logo

thanhbinh84 / flutter_sim_info Goto Github PK

View Code? Open in Web Editor NEW

This project forked from flutter-moum/flutter_sim_info

0.0 0.0 0.0 217 KB

A Flutter plugin for read SIM information.

Home Page: https://pub.dev/packages/sim_info

License: MIT License

Java 26.41% Ruby 24.24% Swift 13.85% Objective-C 2.67% Dart 32.83%

flutter_sim_info's Introduction

flutter_sim_info

A Flutter plugin for read SIM information.
You can get SIM data for MCC, MNC, country name, etc...

Note: There are similarities and differences between the data available on Android and iOS. Read the usage.

Usage

Import the package

In your flutter project add the dependency:

dependencies:
  ...
  sim_info: ^0.1.1

check it out the installing page.

Use the plugin

Add the following import to your Dart code:

import 'package:sim_info/sim_info.dart';

Use below to get SIM data:

  String _allowsVOIP;
  String _carrierName;
  String _isoCountryCode;
  String _mobileCountryCode;
  String _mobileNetworkCode;

  @override
  void initState() {
    super.initState();
    getSimInfo();
  }

  void getSimInfo() async {
    String allowsVOIP = await SimInfo.getAllowsVOIP;
    String carrierName = await SimInfo.getCarrierName;
    String isoCountryCode = await SimInfo.getIsoCountryCode;
    String mobileCountryCode = await SimInfo.getMobileCountryCode;
    String mobileNetworkCode = await SimInfo.getMobileNetworkCode;
  }

Full list of available SIM data.

Android integration

Beginning with Android 6.0 (API level 23), you must obtain bellow permission before using methods.

Dangerous permissions READ_PHONE_STATE

Error message

"PERMISSION_DENIED" // In android, you use methods before get permission.

"SIM_STATE_NOT_READY" // In both, cannot found SIM card in your device.

Screenshots

screenshot

API details

See the WIKI for more API details.

Issues and feedback

Please file issues to send feedback or report a bug. Thank you!

License

MIT license.

flutter_sim_info's People

Contributors

eungikim avatar junyng avatar ykw93 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.