├── ios ├── Assets │ └── .gitkeep ├── Classes │ ├── CarrierInfoPlugin.h │ ├── CarrierInfoPlugin.m │ ├── SwiftCarrierInfoPlugin.swift │ └── Carrier.swift ├── .gitignore └── carrier_info.podspec ├── android ├── settings.gradle ├── gradle.properties ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ └── com │ │ └── chizi │ │ └── carrier_info │ │ ├── CarrierInfoPlugin.kt │ │ └── MethodCallHandlerImpl.kt ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── build.gradle ├── 1.jpeg ├── 1.png ├── lib ├── carrier_info.dart └── src │ ├── src.dart │ ├── models │ ├── models.dart │ ├── ios_carrier_data.dart │ └── android_carrier_data.dart │ └── carrier_info.dart ├── example ├── ios │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── Podfile.lock │ ├── .gitignore │ └── Podfile ├── android │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── chizi │ │ │ │ │ │ └── example │ │ │ │ │ │ └── carrier_info_example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle.kts │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── build.gradle.kts │ └── settings.gradle.kts ├── README.md ├── .gitignore ├── test │ └── widget_test.dart ├── .metadata ├── analysis_options.yaml ├── pubspec.yaml ├── pubspec.lock └── lib │ └── main.dart ├── test └── carrier_info_test.dart ├── .gitignore ├── .pubignore ├── .idea ├── runConfigurations │ └── example_lib_main_dart.xml ├── modules.xml ├── libraries │ └── Dart_SDK.xml └── workspace.xml ├── .metadata ├── .vscode └── launch.json ├── pubspec.yaml ├── LICENSE ├── CHANGELOG.md ├── pubspec.lock ├── iOS_16_DEPRECATION_NOTICE.md └── README.md /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'carrier_info' 2 | -------------------------------------------------------------------------------- /1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/1.jpeg -------------------------------------------------------------------------------- /1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/1.png -------------------------------------------------------------------------------- /lib/carrier_info.dart: -------------------------------------------------------------------------------- 1 | library carrier_info; 2 | 3 | export 'src/src.dart'; 4 | -------------------------------------------------------------------------------- /lib/src/src.dart: -------------------------------------------------------------------------------- 1 | export 'carrier_info.dart'; 2 | export 'models/models.dart'; 3 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/src/models/models.dart: -------------------------------------------------------------------------------- 1 | export 'android_carrier_data.dart'; 2 | export 'ios_carrier_data.dart'; 3 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /ios/Classes/CarrierInfoPlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface CarrierInfoPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /test/carrier_info_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_test/flutter_test.dart'; 2 | 3 | void main() { 4 | TestWidgetsFlutterBinding.ensureInitialized(); 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | # IntelliJ related 10 | *.iml 11 | *.ipr 12 | *.iws 13 | .idea/ 14 | -------------------------------------------------------------------------------- /.pubignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | # IntelliJ related 10 | *.iml 11 | *.ipr 12 | *.iws 13 | .idea/ 14 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zfinix/carrier_info/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/chizi/example/carrier_info_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.chizi.example.carrier_info_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity : FlutterActivity() 6 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip 6 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Aug 29 17:20:08 ICT 2025 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | .cxx/ 9 | 10 | # Remember to never publicly share your keystore. 11 | # See https://flutter.dev/to/reference-keystore 12 | key.properties 13 | **/*.keystore 14 | **/*.jks 15 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 022b333a089afb81c471ec43d1f1f4f26305d876 8 | channel: dev 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "carrier_info", 9 | "request": "launch", 10 | "type": "dart" 11 | }, 12 | { 13 | "name": "example", 14 | "cwd": "example", 15 | "request": "launch", 16 | "type": "dart" 17 | } 18 | ] 19 | } -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - carrier_info (0.0.1): 3 | - Flutter 4 | - Flutter (1.0.0) 5 | 6 | DEPENDENCIES: 7 | - carrier_info (from `.symlinks/plugins/carrier_info/ios`) 8 | - Flutter (from `Flutter`) 9 | 10 | EXTERNAL SOURCES: 11 | carrier_info: 12 | :path: ".symlinks/plugins/carrier_info/ios" 13 | Flutter: 14 | :path: Flutter 15 | 16 | SPEC CHECKSUMS: 17 | carrier_info: 7bce0e30540c371313d12d167af3fb63ce923833 18 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 19 | 20 | PODFILE CHECKSUM: 775997f741c536251164e3eacf6e34abf2eb7a17 21 | 22 | COCOAPODS: 1.16.2 23 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/android/build.gradle.kts: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get() 9 | rootProject.layout.buildDirectory.value(newBuildDir) 10 | 11 | subprojects { 12 | val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) 13 | project.layout.buildDirectory.value(newSubprojectBuildDir) 14 | } 15 | subprojects { 16 | project.evaluationDependsOn(":app") 17 | } 18 | 19 | tasks.register("clean") { 20 | delete(rootProject.layout.buildDirectory) 21 | } 22 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # carrier_info_example 2 | 3 | Demonstrates how to use the carrier_info plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /ios/Classes/CarrierInfoPlugin.m: -------------------------------------------------------------------------------- 1 | #import "CarrierInfoPlugin.h" 2 | #if __has_include() 3 | #import 4 | #else 5 | // Support project import fallback if the generated compatibility header 6 | // is not copied when this plugin is created as a library. 7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 8 | #import "carrier_info-Swift.h" 9 | #endif 10 | 11 | @implementation CarrierInfoPlugin 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | [SwiftCarrierInfoPlugin registerWithRegistrar:registrar]; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /lib/src/carrier_info.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:carrier_info/carrier_info.dart'; 4 | import 'package:flutter/services.dart'; 5 | 6 | class CarrierInfo { 7 | static const MethodChannel _channel = 8 | const MethodChannel('plugins.chizi.tech/carrier_info'); 9 | 10 | /// Get carrier data from android device 11 | static Future getAndroidInfo() async { 12 | return AndroidCarrierData.fromMap( 13 | await _channel.invokeMethod('getAndroidInfo'), 14 | ); 15 | } 16 | 17 | /// Get all carrier data ios device 18 | static Future getIosInfo() async { 19 | return IosCarrierData.fromMap( 20 | await _channel.invokeMethod('getIosInfo'), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/android/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | val flutterSdkPath = run { 3 | val properties = java.util.Properties() 4 | file("local.properties").inputStream().use { properties.load(it) } 5 | val flutterSdkPath = properties.getProperty("flutter.sdk") 6 | require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } 7 | flutterSdkPath 8 | } 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id("dev.flutter.flutter-plugin-loader") version "1.0.0" 21 | id("com.android.application") version "8.7.3" apply false 22 | id("org.jetbrains.kotlin.android") version "2.1.0" apply false 23 | } 24 | 25 | include(":app") 26 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /ios/carrier_info.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint carrier_info.podspec' to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'carrier_info' 7 | s.version = '0.0.1' 8 | s.summary = 'A new flutter plugin project.' 9 | s.description = <<-DESC 10 | A new flutter plugin project. 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.dependency 'Flutter' 18 | s.platform = :ios, '8.0' 19 | 20 | # Flutter.framework does not contain a i386 slice. 21 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } 22 | s.swift_version = '5.0' 23 | end 24 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:carrier_info_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => 22 | widget is Text && widget.data!.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /ios/Classes/SwiftCarrierInfoPlugin.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | @available(iOS 12.0, *) 5 | public class SwiftCarrierInfoPlugin: NSObject, FlutterPlugin { 6 | fileprivate let carrier = Carrier() 7 | 8 | 9 | public static func register(with registrar: FlutterPluginRegistrar) { 10 | let channel = FlutterMethodChannel(name: "plugins.chizi.tech/carrier_info", binaryMessenger: registrar.messenger()) 11 | let instance = SwiftCarrierInfoPlugin() 12 | registrar.addMethodCallDelegate(instance, channel: channel) 13 | } 14 | 15 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 16 | DispatchQueue.main.async { [self] in 17 | switch call.method { 18 | 19 | case "getIosInfo": 20 | result(carrier.carrierInfo) 21 | 22 | default: 23 | result(FlutterMethodNotImplemented) 24 | return 25 | } 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "6fba2447e95c451518584c35e25f5433f14d888c" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 6fba2447e95c451518584c35e25f5433f14d888c 17 | base_revision: 6fba2447e95c451518584c35e25f5433f14d888c 18 | - platform: android 19 | create_revision: 6fba2447e95c451518584c35e25f5433f14d888c 20 | base_revision: 6fba2447e95c451518584c35e25f5433f14d888c 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: carrier_info 2 | description: Carrier Info gets networkType, networkGeneration, mobileCountryCode, mobileCountryCode, e.t.c from both android and ios devices 3 | version: 3.0.3 4 | homepage: https://github.com/Zfinix/carrier_info 5 | 6 | environment: 7 | sdk: ">=3.0.0 <4.0.0" 8 | flutter: ">=1.10.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | 18 | # For information on the generic Dart part of this file, see the 19 | # following page: https://dart.dev/tools/pub/pubspec 20 | 21 | # The following section is specific to Flutter. 22 | flutter: 23 | # This section identifies this Flutter project as a plugin project. 24 | # The 'pluginClass' and Android 'package' identifiers should not ordinarily 25 | # be modified. They are used by the tooling to maintain consistency when 26 | # adding or updating assets for this project. 27 | plugin: 28 | platforms: 29 | android: 30 | package: com.chizi.carrier_info 31 | pluginClass: CarrierInfoPlugin 32 | ios: 33 | pluginClass: CarrierInfoPlugin 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Chiziaruhoma Ogbonda 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.chizi.carrier_info' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.6.10' 6 | repositories { 7 | google() 8 | jcenter() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:4.1.0' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | apply plugin: 'kotlin-android' 26 | 27 | android { 28 | namespace 'com.chizi.carrier_info' 29 | compileSdkVersion 36 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_17 33 | targetCompatibility JavaVersion.VERSION_17 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '17' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | defaultConfig { 44 | minSdkVersion 21 45 | } 46 | lintOptions { 47 | disable 'InvalidPackage' 48 | } 49 | } 50 | 51 | dependencies { 52 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 53 | } 54 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '14.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /example/android/app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.application") 3 | id("kotlin-android") 4 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. 5 | id("dev.flutter.flutter-gradle-plugin") 6 | } 7 | 8 | android { 9 | namespace = "com.chizi.example.carrier_info_example" 10 | compileSdk = flutter.compileSdkVersion 11 | ndkVersion = flutter.ndkVersion 12 | 13 | compileOptions { 14 | sourceCompatibility = JavaVersion.VERSION_17 15 | targetCompatibility = JavaVersion.VERSION_17 16 | } 17 | 18 | kotlinOptions { 19 | jvmTarget = JavaVersion.VERSION_17.toString() 20 | } 21 | 22 | defaultConfig { 23 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 24 | applicationId = "com.chizi.example.carrier_info_example" 25 | // You can update the following values to match your application needs. 26 | // For more information, see: https://flutter.dev/to/review-gradle-config. 27 | minSdk = flutter.minSdkVersion 28 | targetSdk = flutter.targetSdkVersion 29 | versionCode = flutter.versionCode 30 | versionName = flutter.versionName 31 | } 32 | 33 | buildTypes { 34 | release { 35 | // TODO: Add your own signing config for the release build. 36 | // Signing with the debug keys for now, so `flutter run --release` works. 37 | signingConfig = signingConfigs.getByName("debug") 38 | } 39 | } 40 | } 41 | 42 | flutter { 43 | source = "../.." 44 | } 45 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | analyzer: 11 | errors: 12 | deprecated_member_use: ignore 13 | include: package:flutter_lints/flutter.yaml 14 | 15 | linter: 16 | # The lint rules applied to this project can be customized in the 17 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 18 | # included above or to enable additional rules. A list of all available lints 19 | # and their documentation is published at 20 | # https://dart-lang.github.io/linter/lints/index.html. 21 | # 22 | # Instead of disabling a lint rule for the entire project in the 23 | # section below, it can also be suppressed for a single line of code 24 | # or a specific dart file by using the `// ignore: name_of_lint` and 25 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 26 | # producing the lint. 27 | rules: 28 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 29 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 30 | 31 | # Additional information about this file can be found at 32 | # https://dart.dev/guides/language/analysis-options 33 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/chizi/carrier_info/CarrierInfoPlugin.kt: -------------------------------------------------------------------------------- 1 | package com.chizi.carrier_info 2 | 3 | import androidx.annotation.NonNull 4 | import io.flutter.embedding.engine.plugins.FlutterPlugin 5 | import io.flutter.embedding.engine.plugins.activity.ActivityAware 6 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding 7 | import io.flutter.plugin.common.MethodChannel 8 | import io.flutter.plugin.common.PluginRegistry 9 | 10 | 11 | /** CarrierInfoPlugin */ 12 | class CarrierInfoPlugin: FlutterPlugin, 13 | PluginRegistry.RequestPermissionsResultListener, ActivityAware { 14 | /// The MethodChannel that will the communication between Flutter and native Android 15 | /// 16 | /// This local reference serves to register the plugin with the Flutter Engine and unregister it 17 | /// when the Flutter Engine is detached from the Activity 18 | 19 | private var channel: MethodChannel? = null 20 | private val channelID = "plugins.chizi.tech/carrier_info" 21 | private var handler: MethodCallHandlerImpl? = null 22 | 23 | override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { 24 | setupChannel(flutterPluginBinding) 25 | } 26 | 27 | override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { 28 | teardownChannel() 29 | } 30 | 31 | private fun setupChannel(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { 32 | channel = MethodChannel(flutterPluginBinding.binaryMessenger, channelID) 33 | handler = MethodCallHandlerImpl(flutterPluginBinding.applicationContext, null) 34 | channel?.setMethodCallHandler(handler) 35 | } 36 | 37 | override fun onAttachedToActivity(binding: ActivityPluginBinding) { 38 | handler?.setActivity(binding.activity) 39 | } 40 | 41 | override fun onDetachedFromActivityForConfigChanges() { 42 | onDetachedFromActivity() 43 | } 44 | 45 | override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { 46 | onAttachedToActivity(binding) 47 | binding.addRequestPermissionsResultListener(this) 48 | } 49 | 50 | override fun onDetachedFromActivity() { 51 | handler?.setActivity(null) 52 | } 53 | private fun teardownChannel() { 54 | channel?.setMethodCallHandler(null) 55 | channel = null 56 | handler = null 57 | } 58 | 59 | override fun onRequestPermissionsResult(requestCode: Int, permissions: Array, grantResults: IntArray): Boolean { 60 | handler?.onRequestPermissionsResult(requestCode, permissions, grantResults) 61 | return true 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: carrier_info_example 2 | description: Demonstrates how to use the carrier_info plugin. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: "none" # Remove this line if you wish to publish to pub.dev 7 | 8 | environment: 9 | sdk: ">=3.0.0 <4.0.0" 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | carrier_info: 16 | # When depending on this package from a real application you should use: 17 | # carrier_info: ^x.y.z 18 | # See https://dart.dev/tools/pub/dependencies#version-constraints 19 | # The example app is bundled with the plugin so we use a path dependency on 20 | # the parent directory to use the current plugin's version. 21 | path: ../ 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^1.0.1 26 | 27 | dev_dependencies: 28 | flutter_test: 29 | sdk: flutter 30 | 31 | # For information on the generic Dart part of this file, see the 32 | # following page: https://dart.dev/tools/pub/pubspec 33 | 34 | # The following section is specific to Flutter. 35 | flutter: 36 | # The following line ensures that the Material Icons font is 37 | # included with your application, so that you can use the icons in 38 | # the material Icons class. 39 | uses-material-design: true 40 | 41 | # To add assets to your application, add an assets section, like this: 42 | # assets: 43 | # - images/a_dot_burr.jpeg 44 | # - images/a_dot_ham.jpeg 45 | 46 | # An image asset can refer to one or more resolution-specific "variants", see 47 | # https://flutter.dev/assets-and-images/#resolution-aware. 48 | 49 | # For details regarding adding assets from package dependencies, see 50 | # https://flutter.dev/assets-and-images/#from-packages 51 | 52 | # To add custom fonts to your application, add a fonts section here, 53 | # in this "flutter" section. Each entry in this list should have a 54 | # "family" key with the font family name, and a "fonts" key with a 55 | # list giving the asset and other descriptors for the font. For 56 | # example: 57 | # fonts: 58 | # - family: Schyler 59 | # fonts: 60 | # - asset: fonts/Schyler-Regular.ttf 61 | # - asset: fonts/Schyler-Italic.ttf 62 | # style: italic 63 | # - family: Trajan Pro 64 | # fonts: 65 | # - asset: fonts/TrajanPro.ttf 66 | # - asset: fonts/TrajanPro_Bold.ttf 67 | # weight: 700 68 | # 69 | # For details regarding fonts from package dependencies, 70 | # see https://flutter.dev/custom-fonts/#from-packages 71 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ## 3.0.3 3 | * **NEW FEATURES**: Enhanced iOS implementation with comprehensive CoreTelephony data 4 | * Add `isSIMInserted` detection for all iOS versions 5 | * Add `subscriberInfo` with subscriber count, identifiers, and carrier tokens 6 | * Add `cellularPlanInfo` with dedicated eSIM support detection 7 | * Add `networkStatus` with real-time network connectivity information 8 | * Enhanced dual SIM support with proper subscriber counting 9 | * Add new iOS models: `SubscriberInfo`, `CellularPlanInfo`, `NetworkStatus` 10 | * Updated example app to showcase all new iOS features with organized sections 11 | * Updated README with comprehensive iOS features documentation and usage examples 12 | * Improved iOS version detection and capability handling 13 | * All new features work across iOS versions with proper fallbacks 14 | 15 | ## 3.0.2 16 | * **BREAKING CHANGE**: Handle CTCarrier deprecation in iOS 16.0+ 17 | * Add proper iOS version detection and fallback mechanisms 18 | * Most carrier-specific information (carrierName, mobileCountryCode, etc.) will return nil on iOS 16.0+ due to Apple's deprecation of CTCarrier APIs 19 | * Add comprehensive documentation about iOS 16.0+ limitations 20 | * Radio access technology information still works as it doesn't rely on deprecated CTCarrier APIs 21 | * Add _ios_version_info field to help developers detect iOS version and handle limitations 22 | * Add deprecation warnings and notices in iOS implementation 23 | * Update README with detailed iOS limitations section and technical references 24 | 25 | ## 3.0.1 26 | * Fix JVM target compatibility issues with Java 17 27 | * Fix Kotlin compilation errors and null safety issues 28 | * Fix syntax errors in networkGeneration function 29 | * Improve Android build configuration for modern Android development 30 | 31 | ## 3.0.0 32 | * Breaking changes for android 10 and below as Telephony is no longer supported by them 33 | * Removal of permission checking from package, you'll need to manage permission on the mobile end 34 | 35 | ## 2.0.8 36 | * Breaking changes for Multi sim suport 37 | * Syntax clean up 38 | 39 | ## 2.0.6 40 | * Add support for Flutter 2.17.0 (Stable channel) 41 | * Syntax clean up 42 | 43 | ## 2.0.5-beta.2.13.0 44 | * Add support for Flutter 2.13.0 (Beta channel) [slightfoot](https://github.com/slightfoot) 45 | 46 | ## 2.0.5 47 | * fix: request permissions before getting data from the app, added documentation for cid and lac by [nicolaspernoud](https://github.com/nicolaspernoud) 48 | 49 | ## 2.0.4 50 | * Merged PRs to add 5G functionality & fix permission issue 51 | 52 | ## 2.0.3 53 | * Merged PRs to add 5G functionality & fix permission issue 54 | 55 | ## 2.0.2 56 | * Fixed android bug 57 | ## 2.0.1 58 | * Add pub.dev badge to readme 59 | * Fix compilation issue 60 | * bug: fix carrierName typo 61 | * Updated Contribution section in Readme 62 | 63 | ## 2.0.0 64 | * Added null-saftey 65 | 66 | ## 1.0.0 67 | * Initial release. 68 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | 24 | 28 | 32 | 33 | 34 | 35 | 36 | 37 | 39 | 42 | 43 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.13.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.2" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.4.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.2" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.19.1" 44 | fake_async: 45 | dependency: transitive 46 | description: 47 | name: fake_async 48 | sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.3.3" 52 | flutter: 53 | dependency: "direct main" 54 | description: flutter 55 | source: sdk 56 | version: "0.0.0" 57 | flutter_test: 58 | dependency: "direct dev" 59 | description: flutter 60 | source: sdk 61 | version: "0.0.0" 62 | leak_tracker: 63 | dependency: transitive 64 | description: 65 | name: leak_tracker 66 | sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" 67 | url: "https://pub.dev" 68 | source: hosted 69 | version: "10.0.9" 70 | leak_tracker_flutter_testing: 71 | dependency: transitive 72 | description: 73 | name: leak_tracker_flutter_testing 74 | sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 75 | url: "https://pub.dev" 76 | source: hosted 77 | version: "3.0.9" 78 | leak_tracker_testing: 79 | dependency: transitive 80 | description: 81 | name: leak_tracker_testing 82 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 83 | url: "https://pub.dev" 84 | source: hosted 85 | version: "3.0.1" 86 | matcher: 87 | dependency: transitive 88 | description: 89 | name: matcher 90 | sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 91 | url: "https://pub.dev" 92 | source: hosted 93 | version: "0.12.17" 94 | material_color_utilities: 95 | dependency: transitive 96 | description: 97 | name: material_color_utilities 98 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec 99 | url: "https://pub.dev" 100 | source: hosted 101 | version: "0.11.1" 102 | meta: 103 | dependency: transitive 104 | description: 105 | name: meta 106 | sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c 107 | url: "https://pub.dev" 108 | source: hosted 109 | version: "1.16.0" 110 | path: 111 | dependency: transitive 112 | description: 113 | name: path 114 | sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" 115 | url: "https://pub.dev" 116 | source: hosted 117 | version: "1.9.1" 118 | sky_engine: 119 | dependency: transitive 120 | description: flutter 121 | source: sdk 122 | version: "0.0.0" 123 | source_span: 124 | dependency: transitive 125 | description: 126 | name: source_span 127 | sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" 128 | url: "https://pub.dev" 129 | source: hosted 130 | version: "1.10.1" 131 | stack_trace: 132 | dependency: transitive 133 | description: 134 | name: stack_trace 135 | sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" 136 | url: "https://pub.dev" 137 | source: hosted 138 | version: "1.12.1" 139 | stream_channel: 140 | dependency: transitive 141 | description: 142 | name: stream_channel 143 | sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" 144 | url: "https://pub.dev" 145 | source: hosted 146 | version: "2.1.4" 147 | string_scanner: 148 | dependency: transitive 149 | description: 150 | name: string_scanner 151 | sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" 152 | url: "https://pub.dev" 153 | source: hosted 154 | version: "1.4.1" 155 | term_glyph: 156 | dependency: transitive 157 | description: 158 | name: term_glyph 159 | sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" 160 | url: "https://pub.dev" 161 | source: hosted 162 | version: "1.2.2" 163 | test_api: 164 | dependency: transitive 165 | description: 166 | name: test_api 167 | sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd 168 | url: "https://pub.dev" 169 | source: hosted 170 | version: "0.7.4" 171 | vector_math: 172 | dependency: transitive 173 | description: 174 | name: vector_math 175 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 176 | url: "https://pub.dev" 177 | source: hosted 178 | version: "2.1.4" 179 | vm_service: 180 | dependency: transitive 181 | description: 182 | name: vm_service 183 | sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 184 | url: "https://pub.dev" 185 | source: hosted 186 | version: "15.0.0" 187 | sdks: 188 | dart: ">=3.7.0-0 <4.0.0" 189 | flutter: ">=3.18.0-18.0.pre.54" 190 | -------------------------------------------------------------------------------- /iOS_16_DEPRECATION_NOTICE.md: -------------------------------------------------------------------------------- 1 | # iOS 16.0+ CTCarrier Deprecation Notice 2 | 3 | ## Overview 4 | 5 | Starting with iOS 16.0, Apple has deprecated the `CTCarrier` class and related APIs in the CoreTelephony framework. This deprecation significantly impacts the `carrier_info` Flutter plugin's ability to retrieve carrier-specific information on iOS devices running iOS 16.0 or later. 6 | 7 | ## What's Affected 8 | 9 | ### ❌ No Longer Available on iOS 16.0+ 10 | - **Carrier Name** (`carrierName`) - Returns `nil` 11 | - **Mobile Country Code** (`mobileCountryCode`) - Returns `nil` 12 | - **Mobile Network Code** (`mobileNetworkCode`) - Returns `nil` 13 | - **ISO Country Code** (`isoCountryCode`) - Returns `nil` 14 | - **VoIP Allowance** (`carrierAllowsVOIP`) - Returns `nil` 15 | - **Subscriber Identifier** (`subscriberIdentifier`) - Returns `nil` 16 | 17 | ### ✅ Still Available on iOS 16.0+ 18 | - **Radio Access Technology Types** (`carrierRadioAccessTechnologyTypeList`) - Still functional 19 | - **Embedded SIM Support** (`supportsEmbeddedSIM`) - Still functional 20 | - **Current Radio Access Technology** (`serviceCurrentRadioAccessTechnology`) - Still functional 21 | 22 | ## Technical Details 23 | 24 | ### Why This Happened 25 | 26 | Apple deprecated `CTCarrier` for privacy and security reasons. The deprecation is part of Apple's broader initiative to limit access to device identifiers and carrier information that could be used for tracking or fingerprinting users. 27 | 28 | ### Apple's Official Documentation 29 | 30 | From Apple's documentation: 31 | > "CTCarrier is deprecated. Use alternative methods to determine carrier information." 32 | 33 | However, Apple has not provided direct alternatives for most of the deprecated functionality. 34 | 35 | ## Migration Strategies 36 | 37 | ### 1. Version Detection 38 | 39 | Use the `_ios_version_info` field returned by the plugin to detect iOS version and CTCarrier deprecation status: 40 | 41 | ```dart 42 | final iosInfo = await CarrierInfo.getIosInfo(); 43 | final versionInfo = iosInfo?.toMap()['_ios_version_info'] as Map?; 44 | final isDeprecated = versionInfo?['ctcarrier_deprecated'] as bool? ?? false; 45 | 46 | if (isDeprecated) { 47 | // Handle iOS 16.0+ limitations 48 | print('Carrier information is limited on this iOS version'); 49 | } else { 50 | // Full carrier information available 51 | print('Carrier name: ${iosInfo?.carrierData?.first.carrierName}'); 52 | } 53 | ``` 54 | 55 | ### 2. Graceful Degradation 56 | 57 | Design your app to work without carrier-specific information: 58 | 59 | ```dart 60 | String getCarrierDisplayName(IosCarrierData? iosInfo) { 61 | final carrierName = iosInfo?.carrierData?.first.carrierName; 62 | return carrierName ?? 'Unknown Carrier'; 63 | } 64 | ``` 65 | 66 | ### 3. Alternative Data Sources 67 | 68 | Consider these alternatives: 69 | 70 | - **Network-based detection**: Use IP geolocation services 71 | - **User input**: Ask users to select their carrier 72 | - **Android data**: Use Android implementation when available 73 | - **Radio technology**: Use available radio access technology information 74 | 75 | ### 4. Feature Flags 76 | 77 | Implement feature flags to disable carrier-dependent features on iOS 16.0+: 78 | 79 | ```dart 80 | bool shouldShowCarrierFeatures(IosCarrierData? iosInfo) { 81 | final versionInfo = iosInfo?.toMap()['_ios_version_info'] as Map?; 82 | return !(versionInfo?['ctcarrier_deprecated'] as bool? ?? false); 83 | } 84 | ``` 85 | 86 | ## Code Examples 87 | 88 | ### Handling Deprecated Fields 89 | 90 | ```dart 91 | Widget buildCarrierInfo(IosCarrierData? iosInfo) { 92 | final versionInfo = iosInfo?.toMap()['_ios_version_info'] as Map?; 93 | final isDeprecated = versionInfo?['ctcarrier_deprecated'] as bool? ?? false; 94 | 95 | if (isDeprecated) { 96 | return Column( 97 | children: [ 98 | Text('iOS 16.0+ Detected'), 99 | Text('Carrier information is limited'), 100 | Text('Radio Technology: ${iosInfo?.carrierRadioAccessTechnologyTypeList?.join(', ')}'), 101 | ], 102 | ); 103 | } 104 | 105 | return Column( 106 | children: [ 107 | Text('Carrier: ${iosInfo?.carrierData?.first.carrierName ?? 'Unknown'}'), 108 | Text('MCC: ${iosInfo?.carrierData?.first.mobileCountryCode ?? 'Unknown'}'), 109 | Text('MNC: ${iosInfo?.carrierData?.first.mobileNetworkCode ?? 'Unknown'}'), 110 | ], 111 | ); 112 | } 113 | ``` 114 | 115 | ### Fallback UI 116 | 117 | ```dart 118 | Widget buildCarrierSection(IosCarrierData? iosInfo) { 119 | final carrierData = iosInfo?.carrierData?.first; 120 | 121 | if (carrierData?.carrierName == null) { 122 | return Card( 123 | child: Padding( 124 | padding: EdgeInsets.all(16), 125 | child: Column( 126 | children: [ 127 | Icon(Icons.info_outline, color: Colors.orange), 128 | SizedBox(height: 8), 129 | Text('Carrier Information Unavailable'), 130 | Text( 131 | 'iOS 16.0+ limits access to carrier details', 132 | style: TextStyle(fontSize: 12, color: Colors.grey), 133 | ), 134 | ], 135 | ), 136 | ), 137 | ); 138 | } 139 | 140 | return Card( 141 | child: ListTile( 142 | title: Text(carrierData!.carrierName!), 143 | subtitle: Text('${carrierData.mobileCountryCode}-${carrierData.mobileNetworkCode}'), 144 | ), 145 | ); 146 | } 147 | ``` 148 | 149 | ## Testing 150 | 151 | ### Testing on Different iOS Versions 152 | 153 | 1. **iOS 15.x and earlier**: Full functionality should work 154 | 2. **iOS 16.0+**: Expect `nil` values for most carrier fields 155 | 3. **Simulator**: May not reflect real device behavior 156 | 157 | ### Debugging 158 | 159 | Enable debug logging to see deprecation warnings: 160 | 161 | ```swift 162 | // In iOS implementation 163 | print("⚠️ CTCarrier is deprecated in iOS 16.0+. Carrier information will be limited.") 164 | ``` 165 | 166 | ## Recommendations 167 | 168 | 1. **Update your app's logic** to handle `nil` carrier values gracefully 169 | 2. **Inform users** about limited functionality on newer iOS versions 170 | 3. **Use radio technology data** as it's still available and useful 171 | 4. **Consider Android-first approach** for carrier-dependent features 172 | 5. **Test thoroughly** on both iOS 15.x and iOS 16.0+ devices 173 | 174 | ## Future Considerations 175 | 176 | - Apple may provide alternative APIs in future iOS versions 177 | - The plugin will be updated if Apple introduces replacements 178 | - Consider using server-side carrier detection for critical features 179 | 180 | ## Support 181 | 182 | If you encounter issues related to this deprecation: 183 | 184 | 1. Verify the iOS version using `_ios_version_info` 185 | 2. Check if your code handles `nil` values properly 186 | 3. Review the migration strategies above 187 | 4. Consider using Android implementation for carrier-critical features 188 | 189 | --- 190 | 191 | **Note**: This is an Apple platform limitation, not a plugin bug. The plugin correctly implements the available iOS APIs and provides appropriate fallbacks for deprecated functionality. -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.13.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.2" 20 | carrier_info: 21 | dependency: "direct main" 22 | description: 23 | path: ".." 24 | relative: true 25 | source: path 26 | version: "3.0.3" 27 | characters: 28 | dependency: transitive 29 | description: 30 | name: characters 31 | sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 32 | url: "https://pub.dev" 33 | source: hosted 34 | version: "1.4.0" 35 | clock: 36 | dependency: transitive 37 | description: 38 | name: clock 39 | sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b 40 | url: "https://pub.dev" 41 | source: hosted 42 | version: "1.1.2" 43 | collection: 44 | dependency: transitive 45 | description: 46 | name: collection 47 | sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" 48 | url: "https://pub.dev" 49 | source: hosted 50 | version: "1.19.1" 51 | cupertino_icons: 52 | dependency: "direct main" 53 | description: 54 | name: cupertino_icons 55 | sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 56 | url: "https://pub.dev" 57 | source: hosted 58 | version: "1.0.8" 59 | fake_async: 60 | dependency: transitive 61 | description: 62 | name: fake_async 63 | sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" 64 | url: "https://pub.dev" 65 | source: hosted 66 | version: "1.3.3" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_lints: 73 | dependency: transitive 74 | description: 75 | name: flutter_lints 76 | sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" 77 | url: "https://pub.dev" 78 | source: hosted 79 | version: "6.0.0" 80 | flutter_test: 81 | dependency: "direct dev" 82 | description: flutter 83 | source: sdk 84 | version: "0.0.0" 85 | leak_tracker: 86 | dependency: transitive 87 | description: 88 | name: leak_tracker 89 | sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" 90 | url: "https://pub.dev" 91 | source: hosted 92 | version: "10.0.9" 93 | leak_tracker_flutter_testing: 94 | dependency: transitive 95 | description: 96 | name: leak_tracker_flutter_testing 97 | sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 98 | url: "https://pub.dev" 99 | source: hosted 100 | version: "3.0.9" 101 | leak_tracker_testing: 102 | dependency: transitive 103 | description: 104 | name: leak_tracker_testing 105 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 106 | url: "https://pub.dev" 107 | source: hosted 108 | version: "3.0.1" 109 | lints: 110 | dependency: transitive 111 | description: 112 | name: lints 113 | sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 114 | url: "https://pub.dev" 115 | source: hosted 116 | version: "6.0.0" 117 | matcher: 118 | dependency: transitive 119 | description: 120 | name: matcher 121 | sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 122 | url: "https://pub.dev" 123 | source: hosted 124 | version: "0.12.17" 125 | material_color_utilities: 126 | dependency: transitive 127 | description: 128 | name: material_color_utilities 129 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec 130 | url: "https://pub.dev" 131 | source: hosted 132 | version: "0.11.1" 133 | meta: 134 | dependency: transitive 135 | description: 136 | name: meta 137 | sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c 138 | url: "https://pub.dev" 139 | source: hosted 140 | version: "1.16.0" 141 | path: 142 | dependency: transitive 143 | description: 144 | name: path 145 | sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" 146 | url: "https://pub.dev" 147 | source: hosted 148 | version: "1.9.1" 149 | sky_engine: 150 | dependency: transitive 151 | description: flutter 152 | source: sdk 153 | version: "0.0.0" 154 | source_span: 155 | dependency: transitive 156 | description: 157 | name: source_span 158 | sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" 159 | url: "https://pub.dev" 160 | source: hosted 161 | version: "1.10.1" 162 | stack_trace: 163 | dependency: transitive 164 | description: 165 | name: stack_trace 166 | sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "1.12.1" 170 | stream_channel: 171 | dependency: transitive 172 | description: 173 | name: stream_channel 174 | sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "2.1.4" 178 | string_scanner: 179 | dependency: transitive 180 | description: 181 | name: string_scanner 182 | sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" 183 | url: "https://pub.dev" 184 | source: hosted 185 | version: "1.4.1" 186 | term_glyph: 187 | dependency: transitive 188 | description: 189 | name: term_glyph 190 | sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" 191 | url: "https://pub.dev" 192 | source: hosted 193 | version: "1.2.2" 194 | test_api: 195 | dependency: transitive 196 | description: 197 | name: test_api 198 | sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd 199 | url: "https://pub.dev" 200 | source: hosted 201 | version: "0.7.4" 202 | vector_math: 203 | dependency: transitive 204 | description: 205 | name: vector_math 206 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 207 | url: "https://pub.dev" 208 | source: hosted 209 | version: "2.1.4" 210 | vm_service: 211 | dependency: transitive 212 | description: 213 | name: vm_service 214 | sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 215 | url: "https://pub.dev" 216 | source: hosted 217 | version: "15.0.0" 218 | sdks: 219 | dart: ">=3.8.0 <4.0.0" 220 | flutter: ">=3.18.0-18.0.pre.54" 221 | -------------------------------------------------------------------------------- /ios/Classes/Carrier.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Carrier.swift 3 | // carrier_info 4 | // 5 | // From https://github.com/StanislavK/Carrier/blob/master/Carrier/Classes/Carrier.swift 6 | // 7 | // IMPORTANT: CTCarrier is deprecated starting iOS 16.0 8 | // This implementation provides fallback values for iOS 16.0+ to maintain compatibility 9 | // but carrier-specific information will be limited or unavailable on newer iOS versions. 10 | 11 | import UIKit 12 | import CoreTelephony 13 | 14 | enum ShortRadioAccessTechnologyList: String { 15 | case gprs = "GPRS" 16 | case edge = "Edge" 17 | case cdma = "CDMA1x" 18 | case lte = "LTE" 19 | case nrnsa = "NRNSA" 20 | case nr = "NR" 21 | 22 | var generation: String { 23 | switch self { 24 | case .gprs, .edge, .cdma: return "2G" 25 | case .lte: return "4G" 26 | case .nrnsa, .nr: return "5G" 27 | } 28 | } 29 | } 30 | 31 | /// Wraps CTRadioAccessTechnologyDidChange notification 32 | public protocol CarrierDelegate: AnyObject { 33 | func carrierRadioAccessTechnologyDidChange() 34 | } 35 | 36 | @available(iOS 12.0, *) 37 | final public class Carrier { 38 | 39 | // MARK: - Private Properties 40 | private let networkInfo = CTTelephonyNetworkInfo() 41 | private let planProvisioning = CTCellularPlanProvisioning() 42 | private var carriers = [String : CTCarrier]() 43 | private var changeObserver: NSObjectProtocol! 44 | 45 | public init() { 46 | 47 | changeObserver = NotificationCenter.default.addObserver(forName: NSNotification.Name.CTServiceRadioAccessTechnologyDidChange, object: nil, queue: nil) { [unowned self](notification) in 48 | DispatchQueue.main.async { 49 | self.delegate?.carrierRadioAccessTechnologyDidChange() 50 | } 51 | } 52 | 53 | // Handle CTCarrier deprecation in iOS 16.0+ 54 | if #available(iOS 16.0, *) { 55 | // CTCarrier is deprecated in iOS 16.0+ 56 | // serviceSubscriberCellularProviders returns nil or empty data 57 | // We'll provide fallback empty data structure 58 | self.carriers = [:] 59 | print("⚠️ CTCarrier is deprecated in iOS 16.0+. Carrier information will be limited.") 60 | } else if #available(iOS 12.0, *) { 61 | self.carriers = networkInfo.serviceSubscriberCellularProviders ?? [:] 62 | } else { 63 | if(networkInfo.subscriberCellularProvider != nil){ 64 | carriers = ["0": networkInfo.subscriberCellularProvider!] 65 | } 66 | } 67 | } 68 | 69 | deinit { 70 | NotificationCenter.default.removeObserver(changeObserver!) 71 | } 72 | 73 | public weak var delegate: CarrierDelegate? 74 | 75 | /// Returns current radio access technology type used (GPRS, Edge, LTE, etc.) with the carrier. 76 | /// This functionality is still available in iOS 16.0+ as it doesn't rely on CTCarrier. 77 | public var carrierRadioAccessTechnologyTypeList: [String?] { 78 | var technologyList = [String]() 79 | 80 | if #available(iOS 12.0, *) { 81 | let prefix = "CTRadioAccessTechnology" 82 | guard let currentTechnologies = networkInfo.serviceCurrentRadioAccessTechnology else { 83 | return [] 84 | } 85 | 86 | for technology in currentTechnologies.values { 87 | if technology.hasPrefix(prefix) { 88 | technologyList.append(String(technology.dropFirst(prefix.count))) 89 | } else { 90 | technologyList.append(ShortRadioAccessTechnologyList(rawValue: technology)?.generation ?? "3G") 91 | } 92 | } 93 | } 94 | 95 | return technologyList 96 | } 97 | 98 | /// Detects if any SIM card is inserted and active 99 | public var isSIMInserted: Bool { 100 | if #available(iOS 16.0, *) { 101 | // On iOS 16.0+, check if we have any current radio access technology 102 | // This indicates active cellular service 103 | return !(networkInfo.serviceCurrentRadioAccessTechnology?.isEmpty ?? true) 104 | } else { 105 | // Pre-iOS 16.0, check if we have any carriers 106 | return !carriers.isEmpty 107 | } 108 | } 109 | 110 | /// Returns subscriber information including carrier tokens 111 | public var subscriberInfo: [String: Any?] { 112 | var info: [String: Any?] = [:] 113 | 114 | if #available(iOS 16.0, *) { 115 | // Use CTSubscriberInfo for iOS 16.0+ 116 | let subscribers = CTSubscriberInfo.subscribers() 117 | info["subscriberCount"] = subscribers.count 118 | info["subscriberIdentifiers"] = subscribers.compactMap { $0.identifier } 119 | 120 | // Add carrier tokens if available 121 | var carrierTokens: [String] = [] 122 | for subscriber in subscribers { 123 | if let carrierToken = subscriber.carrierToken { 124 | carrierTokens.append(carrierToken.base64EncodedString()) 125 | } 126 | } 127 | info["carrierTokens"] = carrierTokens.isEmpty ? nil : carrierTokens 128 | } else { 129 | // Legacy CTSubscriber for older iOS versions 130 | let subscriber = CTSubscriber() 131 | info["subscriberCount"] = 1 132 | 133 | // Handle subscriber identifier 134 | let subscriberId = subscriber.identifier 135 | info["subscriberIdentifiers"] = [subscriberId] 136 | 137 | // Add carrier token if available 138 | if let carrierToken = subscriber.carrierToken { 139 | info["carrierTokens"] = [carrierToken.base64EncodedString()] 140 | } else { 141 | info["carrierTokens"] = nil 142 | } 143 | } 144 | 145 | return info 146 | } 147 | 148 | /// Returns cellular plan provisioning information 149 | public var cellularPlanInfo: [String: Any?] { 150 | var planInfo: [String: Any?] = [:] 151 | 152 | if #available(iOS 16.0, *) { 153 | planInfo["supportsEmbeddedSIM"] = planProvisioning.supportsEmbeddedSIM 154 | } else { 155 | planInfo["supportsEmbeddedSIM"] = false 156 | } 157 | 158 | return planInfo 159 | } 160 | 161 | /// Returns network connectivity status 162 | public var networkStatus: [String: Any?] { 163 | var status: [String: Any?] = [:] 164 | 165 | // Check if cellular data is available 166 | status["hasCellularData"] = networkInfo.serviceCurrentRadioAccessTechnology != nil 167 | 168 | // Get current radio access technologies 169 | if let currentTechs = networkInfo.serviceCurrentRadioAccessTechnology { 170 | status["activeServices"] = currentTechs.keys.count 171 | status["technologies"] = Array(currentTechs.values) 172 | } else { 173 | status["activeServices"] = 0 174 | status["technologies"] = [] 175 | } 176 | 177 | return status 178 | } 179 | 180 | /// Returns all available info about the carrier. 181 | /// Note: Starting iOS 16.0, CTCarrier is deprecated and most carrier-specific 182 | /// information will return nil or generic values. 183 | public var carrierInfo: [String: Any?] { 184 | 185 | var dataList = [[String: Any?]]() 186 | let subscriberId: String? 187 | 188 | // Handle CTSubscriber deprecation and availability 189 | if #available(iOS 16.0, *) { 190 | // CTSubscriber().identifier is also deprecated in iOS 16.0+ 191 | subscriberId = nil 192 | } else { 193 | subscriberId = CTSubscriber().identifier 194 | } 195 | 196 | // Handle carrier data based on iOS version 197 | if #available(iOS 16.0, *) { 198 | // CTCarrier is deprecated - provide fallback structure 199 | dataList.append([ 200 | "carrierName": nil, 201 | "isoCountryCode": nil, 202 | "mobileCountryCode": nil, 203 | "mobileNetworkCode": nil, 204 | "carrierAllowsVOIP": nil, 205 | "_deprecated_notice": "CTCarrier is deprecated in iOS 16.0+. Carrier information is no longer available." 206 | ]) 207 | } else { 208 | // Pre-iOS 16.0 - use actual carrier data 209 | for carr in carriers.values { 210 | dataList.append([ 211 | "carrierName": carr.carrierName, 212 | "isoCountryCode": carr.isoCountryCode, 213 | "mobileCountryCode": carr.mobileCountryCode, 214 | "mobileNetworkCode": carr.mobileNetworkCode, 215 | "carrierAllowsVOIP": carr.allowsVOIP, 216 | ]) 217 | } 218 | } 219 | 220 | // Convert NSOperatingSystemVersion to dictionary for Flutter method channel 221 | let osVersion = ProcessInfo.processInfo.operatingSystemVersion 222 | let osVersionDict: [String: Any] = [ 223 | "majorVersion": osVersion.majorVersion, 224 | "minorVersion": osVersion.minorVersion, 225 | "patchVersion": osVersion.patchVersion 226 | ] 227 | 228 | // Build comprehensive response 229 | var response: [String: Any?] = [ 230 | "carrierData": dataList, 231 | "carrierRadioAccessTechnologyTypeList": carrierRadioAccessTechnologyTypeList, 232 | "subscriberIdentifier": subscriberId, 233 | "serviceCurrentRadioAccessTechnology": networkInfo.serviceCurrentRadioAccessTechnology, 234 | "isSIMInserted": isSIMInserted, 235 | "subscriberInfo": subscriberInfo, 236 | "cellularPlanInfo": cellularPlanInfo, 237 | "networkStatus": networkStatus, 238 | "_ios_version_info": [ 239 | "ios_version": osVersionDict, 240 | "ctcarrier_deprecated": osVersion.majorVersion >= 16, 241 | "deprecation_notice": osVersion.majorVersion >= 16 ? 242 | "CTCarrier and CTSubscriber are deprecated in iOS 16.0+. Most carrier-specific information is no longer available for privacy and security reasons." : 243 | "CTCarrier functionality is available on this iOS version." 244 | ] 245 | ] 246 | 247 | // Add iOS 16.0+ specific information 248 | if #available(iOS 16.0, *) { 249 | response["subscriberIdentifier2"] = CTSubscriberInfo.subscribers().map{$0.identifier} 250 | } 251 | 252 | return response 253 | } 254 | } 255 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 📱 Carrier Info 2 | 3 | [![pub package](https://img.shields.io/pub/v/carrier_info.svg?label=carrier_info&color=blue)](https://pub.dev/packages/carrier_info) 4 | 5 | > **⚠️ IMPORTANT iOS 16.0+ NOTICE**: Apple has deprecated `CTCarrier` starting with iOS 16.0. This means that most carrier-specific information (carrier name, country codes, network codes, etc.) will return `nil` or generic values on iOS 16.0 and later versions. This is an Apple platform limitation, not a plugin issue. See the [iOS Limitations](#ios-limitations) section for more details. 6 | 7 | Carrier Info gets networkType, networkGeneration, mobileCountryCode, mobileCountryCode, e.t.c from both android and ios devices. It's a port from this [js project](https://github.com/react-native-webrtc/react-native-carrier-info) and an improvement on the existing [flt_telephony_info package](https://pub.dev/packages/flt_telephony_info). 8 | 9 | ## 📸 Screen Shots 10 | 11 |

12 | 13 | 14 |

15 | 16 | ### Fetching android carrier info 17 | 18 | Docs: https://developer.android.com/reference/android/telephony/TelephonyManager#getNetworkCountryIso(), https://developer.android.com/reference/android/telephony/SubscriptionManager 19 | 20 | ```dart 21 | AndroidCarrierData? carrierInfo = await CarrierInfo.getAndroidInfo(); 22 | returns { 23 | "isVoiceCapable": true, 24 | "isDataEnabled": true, 25 | "subscriptionsInfo": [ 26 | { 27 | "mobileCountryCode": "310", 28 | "isOpportunistic": false, 29 | "mobileNetworkCode": "260", 30 | "displayName": "T-Mobile", 31 | "isNetworkRoaming": false, 32 | "simSlotIndex": 0, 33 | "phoneNumber": "+15551234567", 34 | "countryIso": "us", 35 | "subscriptionType": 0, 36 | "cardId": 0, 37 | "isEmbedded": false, 38 | "carrierId": 1, 39 | "subscriptionId": 1, 40 | "simSerialNo": "", 41 | "dataRoaming": 0 42 | } 43 | ], 44 | "isDataCapable": true, 45 | "isMultiSimSupported": "MULTISIM_NOT_SUPPORTED_BY_HARDWARE", 46 | "isSmsCapable": true, 47 | "telephonyInfo": [ 48 | { 49 | "networkCountryIso": "us", 50 | "mobileCountryCode": "310", 51 | "mobileNetworkCode": "260", 52 | "displayName": "T-Mobile", 53 | "simState": "SIM_STATE_READY", 54 | "isoCountryCode": "us", 55 | "cellId": { 56 | "cid": 47108, 57 | "lac": 8514 58 | }, 59 | "phoneNumber": "+15551234567", 60 | "carrierName": "T-Mobile", 61 | "subscriptionId": 1, 62 | "networkGeneration": "4G", 63 | "radioType": "LTE", 64 | "networkOperatorName": "T-Mobile" 65 | } 66 | ] 67 | }; 68 | ``` 69 | 70 | ### Fetching iOS carrier info 71 | 72 | ```dart 73 | IosCarrierData? carrierInfo = await CarrierInfo.getIosInfo(); 74 | 75 | // iOS 15.x and earlier - Full carrier information available 76 | returns { 77 | "carrierData": [ 78 | { 79 | "mobileNetworkCode": "20", 80 | "carrierAllowsVOIP": true, 81 | "mobileCountryCode": "621", 82 | "carrierName": "Airtel", 83 | "isoCountryCode": "ng" 84 | } 85 | ], 86 | "supportsEmbeddedSIM": false, 87 | "carrierRadioAccessTechnologyTypeList": ["LTE"], 88 | "isSIMInserted": true, 89 | "subscriberInfo": { 90 | "subscriberCount": 1, 91 | "subscriberIdentifiers": ["subscriber_id_here"], 92 | "carrierTokens": ["token_here"] 93 | }, 94 | "cellularPlanInfo": { 95 | "supportsEmbeddedSIM": false 96 | }, 97 | "networkStatus": { 98 | "hasCellularData": true, 99 | "activeServices": 1, 100 | "technologies": ["LTE"] 101 | }, 102 | "_ios_version_info": { 103 | "ios_version": {...}, 104 | "ctcarrier_deprecated": false, 105 | "deprecation_notice": "CTCarrier functionality is available on this iOS version." 106 | } 107 | } 108 | 109 | // iOS 16.0+ - Limited carrier information due to CTCarrier deprecation 110 | returns { 111 | "carrierData": [ 112 | { 113 | "mobileNetworkCode": null, 114 | "carrierAllowsVOIP": null, 115 | "mobileCountryCode": null, 116 | "carrierName": null, 117 | "isoCountryCode": null, 118 | "_deprecated_notice": "CTCarrier is deprecated in iOS 16.0+. Carrier information is no longer available." 119 | } 120 | ], 121 | "supportsEmbeddedSIM": false, 122 | "carrierRadioAccessTechnologyTypeList": ["LTE"], 123 | "isSIMInserted": true, 124 | "subscriberInfo": { 125 | "subscriberCount": 1, 126 | "subscriberIdentifiers": ["subscriber_id_here"], 127 | "carrierTokens": ["token_here"] 128 | }, 129 | "cellularPlanInfo": { 130 | "supportsEmbeddedSIM": true 131 | }, 132 | "networkStatus": { 133 | "hasCellularData": true, 134 | "activeServices": 1, 135 | "technologies": ["LTE"] 136 | }, 137 | "_ios_version_info": { 138 | "ios_version": {...}, 139 | "ctcarrier_deprecated": true, 140 | "deprecation_notice": "CTCarrier and CTSubscriber are deprecated in iOS 16.0+. Most carrier-specific information is no longer available for privacy and security reasons." 141 | } 142 | } 143 | ``` 144 | 145 | ## iOS Features 146 | 147 | ### Available on All iOS Versions 148 | 149 | #### SIM Detection 150 | - **isSIMInserted**: Boolean indicating if a SIM card is inserted and active 151 | - **networkStatus**: Real-time network connectivity information 152 | - **carrierRadioAccessTechnologyTypeList**: Current radio technology (2G, 3G, 4G, 5G) 153 | 154 | #### Network Status 155 | ```dart 156 | "networkStatus": { 157 | "hasCellularData": true, // Cellular data available 158 | "activeServices": 1, // Number of active cellular services 159 | "technologies": ["LTE"] // Current radio access technologies 160 | } 161 | ``` 162 | 163 | #### Subscriber Information (iOS 16.0+) 164 | ```dart 165 | "subscriberInfo": { 166 | "subscriberCount": 1, // Number of subscribers (dual SIM) 167 | "subscriberIdentifiers": ["subscriber_id"], // Subscriber identifiers 168 | "carrierTokens": ["token"] // Carrier authentication tokens 169 | } 170 | ``` 171 | 172 | #### Cellular Plan Information 173 | ```dart 174 | "cellularPlanInfo": { 175 | "supportsEmbeddedSIM": true // eSIM support detection 176 | } 177 | ``` 178 | 179 | ### iOS Version Detection 180 | 181 | Use the `_ios_version_info` field to detect capabilities: 182 | 183 | ```dart 184 | final iosInfo = await CarrierInfo.getIosInfo(); 185 | final versionInfo = iosInfo?.toMap()['_ios_version_info'] as Map?; 186 | final isDeprecated = versionInfo?['ctcarrier_deprecated'] as bool? ?? false; 187 | 188 | if (isDeprecated) { 189 | // Handle iOS 16.0+ limitations 190 | print('SIM Inserted: ${iosInfo?.isSIMInserted}'); 191 | print('Network Status: ${iosInfo?.networkStatus?.hasCellularData}'); 192 | print('Radio Tech: ${iosInfo?.carrierRadioAccessTechnologyTypeList}'); 193 | } else { 194 | // Full carrier information available 195 | print('Carrier: ${iosInfo?.carrierData?.first.carrierName}'); 196 | print('MCC: ${iosInfo?.carrierData?.first.mobileCountryCode}'); 197 | } 198 | ``` 199 | 200 | ## iOS Limitations 201 | 202 | ### CTCarrier Deprecation (iOS 16.0+) 203 | 204 | Starting with iOS 16.0, Apple has deprecated the `CTCarrier` class and related APIs for privacy and security reasons. This affects the following information: 205 | 206 | **❌ No longer available on iOS 16.0+:** 207 | - Carrier name (`carrierName`) 208 | - Mobile country code (`mobileCountryCode`) 209 | - Mobile network code (`mobileNetworkCode`) 210 | - ISO country code (`isoCountryCode`) 211 | - VOIP allowance (`carrierAllowsVOIP`) 212 | 213 | **✅ Still available on iOS 16.0+:** 214 | - SIM insertion detection (`isSIMInserted`) 215 | - Radio access technology types (`carrierRadioAccessTechnologyTypeList`) 216 | - Network status (`networkStatus`) 217 | - Subscriber information (`subscriberInfo`) 218 | - Cellular plan information (`cellularPlanInfo`) 219 | 220 | ### Recommendations 221 | 222 | 1. **Check iOS version**: Use the `_ios_version_info` field to determine if you're running on iOS 16.0+ and handle the limitations accordingly. 223 | 224 | 2. **Use available features**: Focus on features that work across all iOS versions: 225 | ```dart 226 | // These work on all iOS versions 227 | final simInserted = iosInfo?.isSIMInserted ?? false; 228 | final hasData = iosInfo?.networkStatus?.hasCellularData ?? false; 229 | final radioTech = iosInfo?.carrierRadioAccessTechnologyTypeList ?? []; 230 | ``` 231 | 232 | 3. **Graceful degradation**: Design your app to work without carrier-specific information on newer iOS versions. 233 | 234 | 4. **Alternative approaches**: Consider using network-based detection or user input for carrier information when needed. 235 | 236 | 5. **Android alternative**: For apps that require detailed carrier information, consider using the Android implementation which still provides full functionality. 237 | 238 | ### New iOS Models 239 | 240 | The plugin now includes enhanced models for iOS data: 241 | 242 | - **IosCarrierData**: Main container with all carrier information 243 | - **CarrierData**: Individual carrier information (nullable fields for iOS 16.0+) 244 | - **SubscriberInfo**: Subscriber and carrier token information 245 | - **CellularPlanInfo**: Cellular plan provisioning information 246 | - **NetworkStatus**: Real-time network connectivity status 247 | 248 | ### Technical References 249 | 250 | - [Apple Developer Documentation - CTCarrier](https://developer.apple.com/documentation/coretelephony/ctcarrier) 251 | - [Apple Developer Documentation - CTSubscriber](https://developer.apple.com/documentation/coretelephony/ctsubscriber) 252 | - [Apple Developer Documentation - CTCellularPlanProvisioning](https://developer.apple.com/documentation/coretelephony/ctcellularplanprovisioning/) 253 | - [Stack Overflow Discussion](https://stackoverflow.com/questions/76919011/ctcarrier-deprecation-issue-ios-16) 254 | - [iOS 16.0 Release Notes](https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-16-release-notes) 255 | 256 | ### Permissions 257 | You should add permissions that are required to your android manifest: 258 | 259 | ```xml 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | ``` 268 | 269 | ## ✨ Contribution 270 | 271 | Lots of PR's would be needed to make this plugin standard, as for iOS there's a permanent limitation for getting the exact data usage, there's only one way around it and it's super complex. 272 | -------------------------------------------------------------------------------- /lib/src/models/ios_carrier_data.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | 5 | class IosCarrierData { 6 | final List carrierData; 7 | final bool supportsEmbeddedSIM; 8 | final List carrierRadioAccessTechnologyTypeList; 9 | final bool isSIMInserted; 10 | final SubscriberInfo? subscriberInfo; 11 | final CellularPlanInfo? cellularPlanInfo; 12 | final NetworkStatus? networkStatus; 13 | 14 | IosCarrierData({ 15 | required this.carrierData, 16 | required this.supportsEmbeddedSIM, 17 | required this.carrierRadioAccessTechnologyTypeList, 18 | required this.isSIMInserted, 19 | this.subscriberInfo, 20 | this.cellularPlanInfo, 21 | this.networkStatus, 22 | }); 23 | 24 | IosCarrierData copyWith({ 25 | List? carrierData, 26 | bool? supportsEmbeddedSIM, 27 | List? carrierRadioAccessTechnologyTypeList, 28 | bool? isSIMInserted, 29 | SubscriberInfo? subscriberInfo, 30 | CellularPlanInfo? cellularPlanInfo, 31 | NetworkStatus? networkStatus, 32 | }) { 33 | return IosCarrierData( 34 | carrierData: carrierData ?? this.carrierData, 35 | supportsEmbeddedSIM: supportsEmbeddedSIM ?? this.supportsEmbeddedSIM, 36 | carrierRadioAccessTechnologyTypeList: 37 | carrierRadioAccessTechnologyTypeList ?? 38 | this.carrierRadioAccessTechnologyTypeList, 39 | isSIMInserted: isSIMInserted ?? this.isSIMInserted, 40 | subscriberInfo: subscriberInfo ?? this.subscriberInfo, 41 | cellularPlanInfo: cellularPlanInfo ?? this.cellularPlanInfo, 42 | networkStatus: networkStatus ?? this.networkStatus, 43 | ); 44 | } 45 | 46 | Map toMap() { 47 | return { 48 | 'carrierData': carrierData.map((x) => x.toMap()).toList(), 49 | 'supportsEmbeddedSIM': supportsEmbeddedSIM, 50 | 'carrierRadioAccessTechnologyTypeList': 51 | carrierRadioAccessTechnologyTypeList, 52 | 'isSIMInserted': isSIMInserted, 53 | 'subscriberInfo': subscriberInfo?.toMap(), 54 | 'cellularPlanInfo': cellularPlanInfo?.toMap(), 55 | 'networkStatus': networkStatus?.toMap(), 56 | }; 57 | } 58 | 59 | factory IosCarrierData.fromMap(Map map) { 60 | return IosCarrierData( 61 | carrierData: List.from( 62 | map['carrierData']?.map( 63 | (x) => CarrierData.fromMap(x), 64 | ) ?? 65 | [], 66 | ), 67 | supportsEmbeddedSIM: map['supportsEmbeddedSIM'] ?? false, 68 | carrierRadioAccessTechnologyTypeList: 69 | List.from(map['carrierRadioAccessTechnologyTypeList'] ?? []), 70 | isSIMInserted: map['isSIMInserted'] ?? false, 71 | subscriberInfo: map['subscriberInfo'] != null 72 | ? SubscriberInfo.fromMap(map['subscriberInfo']) 73 | : null, 74 | cellularPlanInfo: map['cellularPlanInfo'] != null 75 | ? CellularPlanInfo.fromMap(map['cellularPlanInfo']) 76 | : null, 77 | networkStatus: map['networkStatus'] != null 78 | ? NetworkStatus.fromMap(map['networkStatus']) 79 | : null, 80 | ); 81 | } 82 | 83 | String toJson() => json.encode(toMap()); 84 | 85 | factory IosCarrierData.fromJson(String source) => 86 | IosCarrierData.fromMap(json.decode(source)); 87 | 88 | @override 89 | String toString() { 90 | return 'IosCarrierData(carrierData: $carrierData, supportsEmbeddedSIM: $supportsEmbeddedSIM, carrierRadioAccessTechnologyTypeList: $carrierRadioAccessTechnologyTypeList, isSIMInserted: $isSIMInserted, subscriberInfo: $subscriberInfo, cellularPlanInfo: $cellularPlanInfo, networkStatus: $networkStatus)'; 91 | } 92 | 93 | @override 94 | bool operator ==(Object other) { 95 | if (identical(this, other)) return true; 96 | 97 | return other is IosCarrierData && 98 | listEquals(other.carrierData, carrierData) && 99 | other.supportsEmbeddedSIM == supportsEmbeddedSIM && 100 | listEquals(other.carrierRadioAccessTechnologyTypeList, 101 | carrierRadioAccessTechnologyTypeList) && 102 | other.isSIMInserted == isSIMInserted && 103 | other.subscriberInfo == subscriberInfo && 104 | other.cellularPlanInfo == cellularPlanInfo && 105 | other.networkStatus == networkStatus; 106 | } 107 | 108 | @override 109 | int get hashCode { 110 | return carrierData.hashCode ^ 111 | supportsEmbeddedSIM.hashCode ^ 112 | carrierRadioAccessTechnologyTypeList.hashCode ^ 113 | isSIMInserted.hashCode ^ 114 | subscriberInfo.hashCode ^ 115 | cellularPlanInfo.hashCode ^ 116 | networkStatus.hashCode; 117 | } 118 | } 119 | 120 | class CarrierData { 121 | final String? mobileNetworkCode; 122 | final bool? carrierAllowsVOIP; 123 | final String? mobileCountryCode; 124 | final String? carrierName; 125 | final String? isoCountryCode; 126 | 127 | CarrierData({ 128 | this.mobileNetworkCode, 129 | this.carrierAllowsVOIP, 130 | this.mobileCountryCode, 131 | this.carrierName, 132 | this.isoCountryCode, 133 | }); 134 | 135 | CarrierData copyWith({ 136 | String? mobileNetworkCode, 137 | bool? carrierAllowsVOIP, 138 | String? mobileCountryCode, 139 | String? carrierName, 140 | String? isoCountryCode, 141 | }) { 142 | return CarrierData( 143 | mobileNetworkCode: mobileNetworkCode ?? this.mobileNetworkCode, 144 | carrierAllowsVOIP: carrierAllowsVOIP ?? this.carrierAllowsVOIP, 145 | mobileCountryCode: mobileCountryCode ?? this.mobileCountryCode, 146 | carrierName: carrierName ?? this.carrierName, 147 | isoCountryCode: isoCountryCode ?? this.isoCountryCode, 148 | ); 149 | } 150 | 151 | Map toMap() { 152 | return { 153 | 'mobileNetworkCode': mobileNetworkCode, 154 | 'carrierAllowsVOIP': carrierAllowsVOIP, 155 | 'mobileCountryCode': mobileCountryCode, 156 | 'carrierName': carrierName, 157 | 'isoCountryCode': isoCountryCode, 158 | }; 159 | } 160 | 161 | factory CarrierData.fromMap(Map map) { 162 | return CarrierData( 163 | mobileNetworkCode: map['mobileNetworkCode'], 164 | carrierAllowsVOIP: map['carrierAllowsVOIP'], 165 | mobileCountryCode: map['mobileCountryCode'], 166 | carrierName: map['carrierName'], 167 | isoCountryCode: map['isoCountryCode'], 168 | ); 169 | } 170 | 171 | String toJson() => json.encode(toMap()); 172 | 173 | factory CarrierData.fromJson(String source) => 174 | CarrierData.fromMap(json.decode(source)); 175 | 176 | @override 177 | String toString() { 178 | return 'CarrierData(mobileNetworkCode: $mobileNetworkCode, carrierAllowsVOIP: $carrierAllowsVOIP, mobileCountryCode: $mobileCountryCode, carrierName: $carrierName, isoCountryCode: $isoCountryCode)'; 179 | } 180 | 181 | @override 182 | bool operator ==(Object other) { 183 | if (identical(this, other)) return true; 184 | 185 | return other is CarrierData && 186 | other.mobileNetworkCode == mobileNetworkCode && 187 | other.carrierAllowsVOIP == carrierAllowsVOIP && 188 | other.mobileCountryCode == mobileCountryCode && 189 | other.carrierName == carrierName && 190 | other.isoCountryCode == isoCountryCode; 191 | } 192 | 193 | @override 194 | int get hashCode { 195 | return mobileNetworkCode.hashCode ^ 196 | carrierAllowsVOIP.hashCode ^ 197 | mobileCountryCode.hashCode ^ 198 | carrierName.hashCode ^ 199 | isoCountryCode.hashCode; 200 | } 201 | } 202 | 203 | class SubscriberInfo { 204 | final int subscriberCount; 205 | final List subscriberIdentifiers; 206 | final List? carrierTokens; 207 | 208 | SubscriberInfo({ 209 | required this.subscriberCount, 210 | required this.subscriberIdentifiers, 211 | this.carrierTokens, 212 | }); 213 | 214 | SubscriberInfo copyWith({ 215 | int? subscriberCount, 216 | List? subscriberIdentifiers, 217 | List? carrierTokens, 218 | }) { 219 | return SubscriberInfo( 220 | subscriberCount: subscriberCount ?? this.subscriberCount, 221 | subscriberIdentifiers: 222 | subscriberIdentifiers ?? this.subscriberIdentifiers, 223 | carrierTokens: carrierTokens ?? this.carrierTokens, 224 | ); 225 | } 226 | 227 | Map toMap() { 228 | return { 229 | 'subscriberCount': subscriberCount, 230 | 'subscriberIdentifiers': subscriberIdentifiers, 231 | 'carrierTokens': carrierTokens, 232 | }; 233 | } 234 | 235 | factory SubscriberInfo.fromMap(Map map) { 236 | return SubscriberInfo( 237 | subscriberCount: map['subscriberCount'] ?? 0, 238 | subscriberIdentifiers: 239 | List.from(map['subscriberIdentifiers'] ?? []), 240 | carrierTokens: map['carrierTokens'] != null 241 | ? List.from(map['carrierTokens']) 242 | : null, 243 | ); 244 | } 245 | 246 | String toJson() => json.encode(toMap()); 247 | 248 | factory SubscriberInfo.fromJson(String source) => 249 | SubscriberInfo.fromMap(json.decode(source)); 250 | 251 | @override 252 | String toString() { 253 | return 'SubscriberInfo(subscriberCount: $subscriberCount, subscriberIdentifiers: $subscriberIdentifiers, carrierTokens: $carrierTokens)'; 254 | } 255 | 256 | @override 257 | bool operator ==(Object other) { 258 | if (identical(this, other)) return true; 259 | 260 | return other is SubscriberInfo && 261 | other.subscriberCount == subscriberCount && 262 | listEquals(other.subscriberIdentifiers, subscriberIdentifiers) && 263 | listEquals(other.carrierTokens, carrierTokens); 264 | } 265 | 266 | @override 267 | int get hashCode { 268 | return subscriberCount.hashCode ^ 269 | subscriberIdentifiers.hashCode ^ 270 | carrierTokens.hashCode; 271 | } 272 | } 273 | 274 | class CellularPlanInfo { 275 | final bool supportsEmbeddedSIM; 276 | 277 | CellularPlanInfo({ 278 | required this.supportsEmbeddedSIM, 279 | }); 280 | 281 | CellularPlanInfo copyWith({ 282 | bool? supportsEmbeddedSIM, 283 | }) { 284 | return CellularPlanInfo( 285 | supportsEmbeddedSIM: supportsEmbeddedSIM ?? this.supportsEmbeddedSIM, 286 | ); 287 | } 288 | 289 | Map toMap() { 290 | return { 291 | 'supportsEmbeddedSIM': supportsEmbeddedSIM, 292 | }; 293 | } 294 | 295 | factory CellularPlanInfo.fromMap(Map map) { 296 | return CellularPlanInfo( 297 | supportsEmbeddedSIM: map['supportsEmbeddedSIM'] ?? false, 298 | ); 299 | } 300 | 301 | String toJson() => json.encode(toMap()); 302 | 303 | factory CellularPlanInfo.fromJson(String source) => 304 | CellularPlanInfo.fromMap(json.decode(source)); 305 | 306 | @override 307 | String toString() { 308 | return 'CellularPlanInfo(supportsEmbeddedSIM: $supportsEmbeddedSIM)'; 309 | } 310 | 311 | @override 312 | bool operator ==(Object other) { 313 | if (identical(this, other)) return true; 314 | 315 | return other is CellularPlanInfo && 316 | other.supportsEmbeddedSIM == supportsEmbeddedSIM; 317 | } 318 | 319 | @override 320 | int get hashCode { 321 | return supportsEmbeddedSIM.hashCode; 322 | } 323 | } 324 | 325 | class NetworkStatus { 326 | final bool hasCellularData; 327 | final int? activeServices; 328 | final List? technologies; 329 | 330 | NetworkStatus({ 331 | required this.hasCellularData, 332 | this.activeServices, 333 | this.technologies, 334 | }); 335 | 336 | NetworkStatus copyWith({ 337 | bool? hasCellularData, 338 | int? activeServices, 339 | List? technologies, 340 | }) { 341 | return NetworkStatus( 342 | hasCellularData: hasCellularData ?? this.hasCellularData, 343 | activeServices: activeServices ?? this.activeServices, 344 | technologies: technologies ?? this.technologies, 345 | ); 346 | } 347 | 348 | Map toMap() { 349 | return { 350 | 'hasCellularData': hasCellularData, 351 | 'activeServices': activeServices, 352 | 'technologies': technologies, 353 | }; 354 | } 355 | 356 | factory NetworkStatus.fromMap(Map map) { 357 | return NetworkStatus( 358 | hasCellularData: map['hasCellularData'] ?? false, 359 | activeServices: map['activeServices'], 360 | technologies: map['technologies'] != null 361 | ? List.from(map['technologies']) 362 | : null, 363 | ); 364 | } 365 | 366 | String toJson() => json.encode(toMap()); 367 | 368 | factory NetworkStatus.fromJson(String source) => 369 | NetworkStatus.fromMap(json.decode(source)); 370 | 371 | @override 372 | String toString() { 373 | return 'NetworkStatus(hasCellularData: $hasCellularData, activeServices: $activeServices, technologies: $technologies)'; 374 | } 375 | 376 | @override 377 | bool operator ==(Object other) { 378 | if (identical(this, other)) return true; 379 | 380 | return other is NetworkStatus && 381 | other.hasCellularData == hasCellularData && 382 | other.activeServices == activeServices && 383 | listEquals(other.technologies, technologies); 384 | } 385 | 386 | @override 387 | int get hashCode { 388 | return hasCellularData.hashCode ^ 389 | activeServices.hashCode ^ 390 | technologies.hashCode; 391 | } 392 | } 393 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/chizi/carrier_info/MethodCallHandlerImpl.kt: -------------------------------------------------------------------------------- 1 | package com.chizi.carrier_info 2 | 3 | 4 | import android.Manifest 5 | import android.app.Activity 6 | import android.content.Context 7 | import android.content.pm.PackageManager 8 | import android.os.Build 9 | import android.os.Handler 10 | import android.os.Looper 11 | import android.telephony.SubscriptionManager 12 | import android.telephony.TelephonyManager 13 | import android.telephony.cdma.CdmaCellLocation 14 | import android.telephony.gsm.GsmCellLocation 15 | import androidx.annotation.RequiresApi 16 | import androidx.core.app.ActivityCompat 17 | import androidx.core.content.ContextCompat 18 | import io.flutter.plugin.common.MethodCall 19 | import io.flutter.plugin.common.MethodChannel 20 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 21 | import java.lang.Exception 22 | 23 | 24 | internal class MethodCallHandlerImpl(context: Context, activity: Activity?) : MethodCallHandler { 25 | private val TAG: String = "carrier_info" 26 | private var context: Context? 27 | private var activity: Activity? 28 | private val E_NO_CARRIER_NAME = "no_carrier_name" 29 | private val E_NO_NETWORK_TYPE = "no_network_type" 30 | private val E_NO_ISO_COUNTRY_CODE = "no_iso_country_code" 31 | private val E_NO_MOBILE_COUNTRY_CODE = "no_mobile_country_code" 32 | private val E_NO_MOBILE_NETWORK = "no_mobile_network" 33 | private val E_NO_NETWORK_OPERATOR = "no_network_operator" 34 | private val E_NO_CELL_ID = "no_cell_id" 35 | private var mTelephonyManager: TelephonyManager? = null 36 | private lateinit var func: () -> Unit? 37 | 38 | 39 | fun setActivity(act: Activity?) { 40 | this.activity = act 41 | } 42 | 43 | init { 44 | this.activity = activity 45 | this.context = context 46 | 47 | mTelephonyManager = context.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager 48 | 49 | } 50 | 51 | override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { 52 | Handler(Looper.getMainLooper()).post { 53 | when (call.method) { 54 | "getAndroidInfo" -> { 55 | try { 56 | getInfo(result) 57 | } catch (e: Exception) { 58 | 59 | result.error(E_NO_CARRIER_NAME, "No carrier name", e.toString()) 60 | 61 | } 62 | } 63 | else -> { 64 | result.notImplemented() 65 | } 66 | } 67 | } 68 | } 69 | 70 | 71 | private fun requestForSpecificPermission(i: Int) { 72 | ActivityCompat.requestPermissions(this.activity!!, arrayOf(Manifest.permission.READ_PHONE_STATE, Manifest.permission.ACCESS_NETWORK_STATE, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION), i) 73 | } 74 | 75 | private fun checkIfAlreadyHavePermission(): Boolean { 76 | return ContextCompat.checkSelfPermission(this.activity!!, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED && 77 | ContextCompat.checkSelfPermission(this.activity!!, Manifest.permission.ACCESS_NETWORK_STATE) == PackageManager.PERMISSION_GRANTED && 78 | ContextCompat.checkSelfPermission(this.activity!!, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED && 79 | ContextCompat.checkSelfPermission(this.activity!!, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED 80 | } 81 | 82 | 83 | private fun getInfo(result: MethodChannel.Result) { 84 | 85 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { 86 | val telephonyList: ArrayList> = ArrayList() 87 | for (i in 0 until mTelephonyManager!!.phoneCount) { 88 | val data = hashMapOf( 89 | "carrierName" to mTelephonyManager!!.simOperatorName, 90 | "dataActivity" to mTelephonyManager!!.dataActivity, 91 | "radioType" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) radioType() else null, 92 | "cellId" to cellId(), 93 | "simState" to simState(i), 94 | "phoneNumber" to mTelephonyManager!!.line1Number, 95 | "networkOperatorName" to mTelephonyManager!!.networkOperatorName, 96 | "subscriptionId" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) mTelephonyManager!!.subscriptionId else null, 97 | "isoCountryCode" to mTelephonyManager!!.simCountryIso, 98 | "networkCountryIso" to mTelephonyManager!!.getNetworkCountryIso(i), 99 | "mobileNetworkCode" to mTelephonyManager!!.simOperator?.substring(3), 100 | "displayName" to mTelephonyManager!!.simOperatorName, 101 | "mobileCountryCode" to mTelephonyManager!!.simOperator?.substring(0, 3), 102 | "networkGeneration" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) networkGeneration() else null, 103 | ) 104 | 105 | telephonyList.add(data) 106 | } 107 | 108 | val subscriptionsList: ArrayList> = ArrayList() 109 | val subsManager = context!!.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE) as SubscriptionManager 110 | 111 | val activeSubscriptions = subsManager.activeSubscriptionInfoList 112 | if (activeSubscriptions != null) { 113 | 114 | for (subsInfo in activeSubscriptions) { 115 | if (subsInfo != null) { 116 | try { 117 | val data = hashMapOf( 118 | "simSerialNo" to subsInfo.iccId, 119 | "mobileCountryCode" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) subsInfo.mccString else null, 120 | "countryIso" to subsInfo.countryIso, 121 | "mobileNetworkCode" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) subsInfo.mncString else null, 122 | "cardId" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) subsInfo.cardId else null, 123 | "carrierId" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) subsInfo.carrierId else null, 124 | "dataRoaming" to subsInfo.dataRoaming, 125 | "isEmbedded" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) subsInfo.isEmbedded else null, 126 | "simSlotIndex" to subsInfo.simSlotIndex, 127 | "subscriptionType" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) subsInfo.subscriptionType else null, 128 | "isOpportunistic" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) subsInfo.isOpportunistic else null, 129 | "displayName" to subsInfo.displayName, 130 | "subscriptionId" to subsInfo.subscriptionId, 131 | "phoneNumber" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) subsManager.getPhoneNumber(subsInfo.subscriptionId) else subsInfo.number, 132 | "isNetworkRoaming" to subsManager.isNetworkRoaming(subsInfo.subscriptionId), 133 | ) 134 | 135 | subscriptionsList.add(data) 136 | } catch (e: Exception) { 137 | subscriptionsList.add(HashMap()) 138 | } 139 | } 140 | } 141 | } 142 | 143 | val data = hashMapOf( 144 | 145 | "isDataEnabled" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) mTelephonyManager!!.isDataEnabled else null, 146 | "isMultiSimSupported" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) isMultiSimSupported() else null, 147 | "isDataCapable" to if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) mTelephonyManager!!.isDataCapable else null, 148 | "isSmsCapable" to mTelephonyManager!!.isSmsCapable, 149 | "isVoiceCapable" to mTelephonyManager!!.isVoiceCapable, 150 | "telephonyInfo" to telephonyList, 151 | "subscriptionsInfo" to subscriptionsList, 152 | ); 153 | 154 | result.success(data) 155 | } else { 156 | 157 | result.error(E_NO_CARRIER_NAME, "No carrier name", "") 158 | } 159 | 160 | 161 | } 162 | 163 | 164 | @RequiresApi(Build.VERSION_CODES.N) 165 | private fun radioType(): String { 166 | return when (mTelephonyManager!!.dataNetworkType) { 167 | TelephonyManager.NETWORK_TYPE_1xRTT -> return "1xRTT" 168 | TelephonyManager.NETWORK_TYPE_CDMA -> return "CDMA" 169 | TelephonyManager.NETWORK_TYPE_EDGE -> return "EDGE" 170 | TelephonyManager.NETWORK_TYPE_EHRPD -> return "eHRPD" 171 | TelephonyManager.NETWORK_TYPE_EVDO_0 -> return "EVDO rev. 0" 172 | TelephonyManager.NETWORK_TYPE_EVDO_A -> return "EVDO rev. A" 173 | TelephonyManager.NETWORK_TYPE_EVDO_B -> return "EVDO rev. B" 174 | TelephonyManager.NETWORK_TYPE_GPRS -> return "GPRS" 175 | TelephonyManager.NETWORK_TYPE_GSM -> return "GSM" 176 | TelephonyManager.NETWORK_TYPE_HSDPA -> return "HSDPA" 177 | TelephonyManager.NETWORK_TYPE_HSPA -> return "HSPA" 178 | TelephonyManager.NETWORK_TYPE_HSPAP -> return "HSPA+" 179 | TelephonyManager.NETWORK_TYPE_HSUPA -> return "HSUPA" 180 | TelephonyManager.NETWORK_TYPE_IDEN -> return "iDen" 181 | TelephonyManager.NETWORK_TYPE_UMTS -> return "UMTS" 182 | TelephonyManager.NETWORK_TYPE_LTE -> return "LTE" 183 | TelephonyManager.NETWORK_TYPE_NR -> return "NR" 184 | TelephonyManager.NETWORK_TYPE_TD_SCDMA -> return "TD SCDMA" 185 | TelephonyManager.NETWORK_TYPE_IWLAN -> return "IWLAN" 186 | TelephonyManager.NETWORK_TYPE_UNKNOWN -> return "Unknown" 187 | else -> "" 188 | } 189 | } 190 | 191 | 192 | private fun isMultiSimSupported(): String { 193 | return when (mTelephonyManager!!.isMultiSimSupported()) { 194 | TelephonyManager.MULTISIM_ALLOWED -> return "MULTISIM_ALLOWED" 195 | TelephonyManager.MULTISIM_NOT_SUPPORTED_BY_CARRIER -> return "MULTISIM_NOT_SUPPORTED_BY_CARRIER" 196 | TelephonyManager.MULTISIM_NOT_SUPPORTED_BY_HARDWARE -> return "MULTISIM_NOT_SUPPORTED_BY_HARDWARE" 197 | else -> "" 198 | } 199 | } 200 | 201 | 202 | private fun simState(i: Int): String { 203 | return when (mTelephonyManager!!.getSimState(i)) { 204 | TelephonyManager.SIM_STATE_ABSENT -> return "SIM_STATE_ABSENT" 205 | TelephonyManager.SIM_STATE_CARD_IO_ERROR -> return "SIM_STATE_CARD_IO_ERROR" 206 | TelephonyManager.SIM_STATE_CARD_RESTRICTED -> return "SIM_STATE_CARD_RESTRICTED" 207 | TelephonyManager.SIM_STATE_NETWORK_LOCKED -> return "SIM_STATE_NETWORK_LOCKED" 208 | TelephonyManager.SIM_STATE_NOT_READY -> return "SIM_STATE_NOT_READY" 209 | TelephonyManager.SIM_STATE_PERM_DISABLED -> return "SIM_STATE_PERM_DISABLED" 210 | TelephonyManager.SIM_STATE_PIN_REQUIRED -> return "SIM_STATE_PIN_REQUIRED" 211 | TelephonyManager.SIM_STATE_PUK_REQUIRED -> return "SIM_STATE_PUK_REQUIRED" 212 | TelephonyManager.SIM_STATE_READY -> return "SIM_STATE_READY" 213 | TelephonyManager.SIM_STATE_UNKNOWN -> return "SIM_STATE_UNKNOWN" 214 | else -> "" 215 | } 216 | } 217 | 218 | @RequiresApi(Build.VERSION_CODES.N) 219 | private fun networkGeneration(): String { 220 | val radioType = mTelephonyManager?.dataNetworkType 221 | if (radioType != null) { 222 | when (radioType) { 223 | TelephonyManager.NETWORK_TYPE_GPRS, 224 | TelephonyManager.NETWORK_TYPE_EDGE, 225 | TelephonyManager.NETWORK_TYPE_CDMA, 226 | TelephonyManager.NETWORK_TYPE_1xRTT, 227 | TelephonyManager.NETWORK_TYPE_IDEN, 228 | TelephonyManager.NETWORK_TYPE_GSM 229 | -> return "2G" 230 | TelephonyManager.NETWORK_TYPE_UMTS, 231 | TelephonyManager.NETWORK_TYPE_EVDO_0, 232 | TelephonyManager.NETWORK_TYPE_EVDO_A, 233 | TelephonyManager.NETWORK_TYPE_HSDPA, 234 | TelephonyManager.NETWORK_TYPE_HSUPA, 235 | TelephonyManager.NETWORK_TYPE_HSPA, 236 | TelephonyManager.NETWORK_TYPE_EVDO_B, 237 | TelephonyManager.NETWORK_TYPE_EHRPD, 238 | TelephonyManager.NETWORK_TYPE_HSPAP, 239 | TelephonyManager.NETWORK_TYPE_TD_SCDMA 240 | -> return "3G" 241 | TelephonyManager.NETWORK_TYPE_LTE 242 | -> return "4G" 243 | TelephonyManager.NETWORK_TYPE_NR 244 | -> return "5G" 245 | else -> radioType.toString() 246 | } 247 | 248 | } 249 | return "unknown" 250 | } 251 | 252 | // return cell id 253 | private fun cellId(): HashMap? { 254 | val location = mTelephonyManager!!.cellLocation 255 | if (location != null) { 256 | var cid = -1 257 | var lac = -1 258 | if (location is GsmCellLocation) { 259 | cid = location.cid 260 | lac = (location).lac 261 | 262 | } else if (location is CdmaCellLocation) { 263 | cid = (location).baseStationId 264 | lac = (location).networkId 265 | } 266 | 267 | return hashMapOf( 268 | "cid" to cid, 269 | "lac" to lac 270 | ) 271 | 272 | } 273 | 274 | return null; 275 | } 276 | 277 | 278 | fun onRequestPermissionsResult(requestCode: Int, permissions: Array?, grantResults: IntArray?) { 279 | when (requestCode) { 280 | 0 -> return if (grantResults!![0] == PackageManager.PERMISSION_GRANTED) { 281 | this.func()!! 282 | 283 | } else { 284 | requestForSpecificPermission(0) 285 | 286 | } 287 | 1 -> return if (grantResults!![0] == PackageManager.PERMISSION_GRANTED) { 288 | this.func()!! 289 | 290 | } else { 291 | requestForSpecificPermission(1) 292 | 293 | } 294 | 2 -> return if (grantResults!![0] == PackageManager.PERMISSION_GRANTED) { 295 | this.func()!! 296 | 297 | } else { 298 | requestForSpecificPermission(2) 299 | } 300 | } 301 | } 302 | } 303 | 304 | -------------------------------------------------------------------------------- /lib/src/models/android_carrier_data.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:flutter/foundation.dart'; 3 | 4 | class AndroidCarrierData { 5 | final bool isVoiceCapable; 6 | final bool isDataEnabled; 7 | final List subscriptionsInfo; 8 | final bool isDataCapable; 9 | final String isMultiSimSupported; 10 | final bool isSmsCapable; 11 | final List telephonyInfo; 12 | AndroidCarrierData({ 13 | required this.isVoiceCapable, 14 | required this.isDataEnabled, 15 | required this.subscriptionsInfo, 16 | required this.isDataCapable, 17 | required this.isMultiSimSupported, 18 | required this.isSmsCapable, 19 | required this.telephonyInfo, 20 | }); 21 | 22 | AndroidCarrierData copyWith({ 23 | bool? isVoiceCapable, 24 | bool? isDataEnabled, 25 | List? subscriptionsInfo, 26 | bool? isDataCapable, 27 | String? isMultiSimSupported, 28 | bool? isSmsCapable, 29 | List? telephonyInfo, 30 | }) { 31 | return AndroidCarrierData( 32 | isVoiceCapable: isVoiceCapable ?? this.isVoiceCapable, 33 | isDataEnabled: isDataEnabled ?? this.isDataEnabled, 34 | subscriptionsInfo: subscriptionsInfo ?? this.subscriptionsInfo, 35 | isDataCapable: isDataCapable ?? this.isDataCapable, 36 | isMultiSimSupported: isMultiSimSupported ?? this.isMultiSimSupported, 37 | isSmsCapable: isSmsCapable ?? this.isSmsCapable, 38 | telephonyInfo: telephonyInfo ?? this.telephonyInfo, 39 | ); 40 | } 41 | 42 | Map toMap() { 43 | return { 44 | 'isVoiceCapable': isVoiceCapable, 45 | 'isDataEnabled': isDataEnabled, 46 | 'subscriptionsInfo': subscriptionsInfo.map((x) => x.toMap()).toList(), 47 | 'isDataCapable': isDataCapable, 48 | 'isMultiSimSupported': isMultiSimSupported, 49 | 'isSmsCapable': isSmsCapable, 50 | 'telephonyInfo': telephonyInfo.map((x) => x.toMap()).toList(), 51 | }; 52 | } 53 | 54 | factory AndroidCarrierData.fromMap(Map map) { 55 | return AndroidCarrierData( 56 | isVoiceCapable: map['isVoiceCapable'] ?? false, 57 | isDataEnabled: map['isDataEnabled'] ?? false, 58 | subscriptionsInfo: List.from( 59 | map['subscriptionsInfo']?.map((x) => SubscriptionsInfo.fromMap(x))), 60 | isDataCapable: map['isDataCapable'] ?? false, 61 | isMultiSimSupported: map['isMultiSimSupported'] ?? '', 62 | isSmsCapable: map['isSmsCapable'] ?? false, 63 | telephonyInfo: List.from( 64 | map['telephonyInfo']?.map((x) => TelephonyInfo.fromMap(x))), 65 | ); 66 | } 67 | 68 | String toJson() => json.encode(toMap()); 69 | 70 | factory AndroidCarrierData.fromJson(String source) => 71 | AndroidCarrierData.fromMap(json.decode(source)); 72 | 73 | @override 74 | String toString() { 75 | return 'AndroidCarrierData(isVoiceCapable: $isVoiceCapable, isDataEnabled: $isDataEnabled, subscriptionsInfo: $subscriptionsInfo, isDataCapable: $isDataCapable, isMultiSimSupported: $isMultiSimSupported, isSmsCapable: $isSmsCapable, telephonyInfo: $telephonyInfo)'; 76 | } 77 | 78 | @override 79 | bool operator ==(Object other) { 80 | if (identical(this, other)) return true; 81 | 82 | return other is AndroidCarrierData && 83 | other.isVoiceCapable == isVoiceCapable && 84 | other.isDataEnabled == isDataEnabled && 85 | listEquals(other.subscriptionsInfo, subscriptionsInfo) && 86 | other.isDataCapable == isDataCapable && 87 | other.isMultiSimSupported == isMultiSimSupported && 88 | other.isSmsCapable == isSmsCapable && 89 | listEquals(other.telephonyInfo, telephonyInfo); 90 | } 91 | 92 | @override 93 | int get hashCode { 94 | return isVoiceCapable.hashCode ^ 95 | isDataEnabled.hashCode ^ 96 | subscriptionsInfo.hashCode ^ 97 | isDataCapable.hashCode ^ 98 | isMultiSimSupported.hashCode ^ 99 | isSmsCapable.hashCode ^ 100 | telephonyInfo.hashCode; 101 | } 102 | } 103 | 104 | class SubscriptionsInfo { 105 | /// The mobile country code (MCC) for the user’s cellular service provider. 106 | final String mobileCountryCode; 107 | final bool isOpportunistic; 108 | 109 | /// The mobile network code (MNC) for the user’s cellular service provider. 110 | final String mobileNetworkCode; 111 | 112 | /// The name of the user’s home cellular service provider. 113 | final String displayName; 114 | final bool isNetworkRoaming; 115 | final int simSlotIndex; 116 | final String phoneNumber; 117 | 118 | /// The ISO country code for the user’s cellular service provider. 119 | final String countryIso; 120 | final int subscriptionType; 121 | final int cardId; 122 | final bool isEmbedded; 123 | final int carrierId; 124 | final int subscriptionId; 125 | final String simSerialNo; 126 | final int dataRoaming; 127 | SubscriptionsInfo({ 128 | required this.mobileCountryCode, 129 | required this.isOpportunistic, 130 | required this.mobileNetworkCode, 131 | required this.displayName, 132 | required this.isNetworkRoaming, 133 | required this.simSlotIndex, 134 | required this.phoneNumber, 135 | required this.countryIso, 136 | required this.subscriptionType, 137 | required this.cardId, 138 | required this.isEmbedded, 139 | required this.carrierId, 140 | required this.subscriptionId, 141 | required this.simSerialNo, 142 | required this.dataRoaming, 143 | }); 144 | 145 | SubscriptionsInfo copyWith({ 146 | String? mobileCountryCode, 147 | bool? isOpportunistic, 148 | String? mobileNetworkCode, 149 | String? displayName, 150 | bool? isNetworkRoaming, 151 | int? simSlotIndex, 152 | String? phoneNumber, 153 | String? countryIso, 154 | int? subscriptionType, 155 | int? cardId, 156 | bool? isEmbedded, 157 | int? carrierId, 158 | int? subscriptionId, 159 | String? simSerialNo, 160 | int? dataRoaming, 161 | }) { 162 | return SubscriptionsInfo( 163 | mobileCountryCode: mobileCountryCode ?? this.mobileCountryCode, 164 | isOpportunistic: isOpportunistic ?? this.isOpportunistic, 165 | mobileNetworkCode: mobileNetworkCode ?? this.mobileNetworkCode, 166 | displayName: displayName ?? this.displayName, 167 | isNetworkRoaming: isNetworkRoaming ?? this.isNetworkRoaming, 168 | simSlotIndex: simSlotIndex ?? this.simSlotIndex, 169 | phoneNumber: phoneNumber ?? this.phoneNumber, 170 | countryIso: countryIso ?? this.countryIso, 171 | subscriptionType: subscriptionType ?? this.subscriptionType, 172 | cardId: cardId ?? this.cardId, 173 | isEmbedded: isEmbedded ?? this.isEmbedded, 174 | carrierId: carrierId ?? this.carrierId, 175 | subscriptionId: subscriptionId ?? this.subscriptionId, 176 | simSerialNo: simSerialNo ?? this.simSerialNo, 177 | dataRoaming: dataRoaming ?? this.dataRoaming, 178 | ); 179 | } 180 | 181 | Map toMap() { 182 | return { 183 | 'mobileCountryCode': mobileCountryCode, 184 | 'isOpportunistic': isOpportunistic, 185 | 'mobileNetworkCode': mobileNetworkCode, 186 | 'displayName': displayName, 187 | 'isNetworkRoaming': isNetworkRoaming, 188 | 'simSlotIndex': simSlotIndex, 189 | 'phoneNumber': phoneNumber, 190 | 'countryIso': countryIso, 191 | 'subscriptionType': subscriptionType, 192 | 'cardId': cardId, 193 | 'isEmbedded': isEmbedded, 194 | 'carrierId': carrierId, 195 | 'subscriptionId': subscriptionId, 196 | 'simSerialNo': simSerialNo, 197 | 'dataRoaming': dataRoaming, 198 | }; 199 | } 200 | 201 | factory SubscriptionsInfo.fromMap(Map map) { 202 | return SubscriptionsInfo( 203 | mobileCountryCode: map['mobileCountryCode'] ?? '', 204 | isOpportunistic: map['isOpportunistic'] ?? false, 205 | mobileNetworkCode: map['mobileNetworkCode'] ?? '', 206 | displayName: map['displayName'] ?? '', 207 | isNetworkRoaming: map['isNetworkRoaming'] ?? false, 208 | simSlotIndex: map['simSlotIndex'] ?? 0, 209 | phoneNumber: map['phoneNumber'] ?? '', 210 | countryIso: map['countryIso'] ?? '', 211 | subscriptionType: map['subscriptionType'] ?? 0, 212 | cardId: map['cardId'] ?? 0, 213 | isEmbedded: map['isEmbedded'] ?? false, 214 | carrierId: map['carrierId'] ?? 0, 215 | subscriptionId: map['subscriptionId'] ?? 0, 216 | simSerialNo: map['simSerialNo'] ?? '', 217 | dataRoaming: map['dataRoaming'] ?? 0, 218 | ); 219 | } 220 | 221 | String toJson() => json.encode(toMap()); 222 | 223 | factory SubscriptionsInfo.fromJson(String source) => 224 | SubscriptionsInfo.fromMap(json.decode(source)); 225 | 226 | @override 227 | String toString() { 228 | return 'SubscriptionsInfo(mobileCountryCode: $mobileCountryCode, isOpportunistic: $isOpportunistic, mobileNetworkCode: $mobileNetworkCode, displayName: $displayName, isNetworkRoaming: $isNetworkRoaming, simSlotIndex: $simSlotIndex, phoneNumber: $phoneNumber, countryIso: $countryIso, subscriptionType: $subscriptionType, cardId: $cardId, isEmbedded: $isEmbedded, carrierId: $carrierId, subscriptionId: $subscriptionId, simSerialNo: $simSerialNo, dataRoaming: $dataRoaming)'; 229 | } 230 | 231 | @override 232 | bool operator ==(Object other) { 233 | if (identical(this, other)) return true; 234 | 235 | return other is SubscriptionsInfo && 236 | other.mobileCountryCode == mobileCountryCode && 237 | other.isOpportunistic == isOpportunistic && 238 | other.mobileNetworkCode == mobileNetworkCode && 239 | other.displayName == displayName && 240 | other.isNetworkRoaming == isNetworkRoaming && 241 | other.simSlotIndex == simSlotIndex && 242 | other.phoneNumber == phoneNumber && 243 | other.countryIso == countryIso && 244 | other.subscriptionType == subscriptionType && 245 | other.cardId == cardId && 246 | other.isEmbedded == isEmbedded && 247 | other.carrierId == carrierId && 248 | other.subscriptionId == subscriptionId && 249 | other.simSerialNo == simSerialNo && 250 | other.dataRoaming == dataRoaming; 251 | } 252 | 253 | @override 254 | int get hashCode { 255 | return mobileCountryCode.hashCode ^ 256 | isOpportunistic.hashCode ^ 257 | mobileNetworkCode.hashCode ^ 258 | displayName.hashCode ^ 259 | isNetworkRoaming.hashCode ^ 260 | simSlotIndex.hashCode ^ 261 | phoneNumber.hashCode ^ 262 | countryIso.hashCode ^ 263 | subscriptionType.hashCode ^ 264 | cardId.hashCode ^ 265 | isEmbedded.hashCode ^ 266 | carrierId.hashCode ^ 267 | subscriptionId.hashCode ^ 268 | simSerialNo.hashCode ^ 269 | dataRoaming.hashCode; 270 | } 271 | } 272 | 273 | class TelephonyInfo { 274 | final String networkCountryIso; 275 | final String mobileCountryCode; 276 | 277 | /// The mobile network code (MNC) for the user’s cellular service provider. 278 | final String mobileNetworkCode; 279 | 280 | /// The name of the user’s home cellular service provider. 281 | final String displayName; 282 | 283 | /// Constant indicating the state of the device SIM card in a logical slot; SIM_STATE_UNKNOWN, SIM_STATE_ABSENT, SIM_STATE_PIN_REQUIRED, SIM_STATE_PUK_REQUIRED, SIM_STATE_NETWORK_LOCKED, SIM_STATE_READY, SIM_STATE_NOT_READY, SIM_STATE_PERM_DISABLED, SIM_STATE_CARD_IO_ERROR, SIM_STATE_CARD_RESTRICTED, 284 | final String simState; 285 | 286 | /// The ISO country code for the user’s cellular service provider. 287 | final String isoCountryCode; 288 | 289 | /// The cell id (cid) and local area code 290 | final CellId? cellId; 291 | 292 | /// Phone number of the sim 293 | final String phoneNumber; 294 | 295 | /// Carrier name of the sim 296 | final String carrierName; 297 | 298 | final int subscriptionId; 299 | 300 | /// The mobile network radioType: 5G, 4G ... 2G 301 | final String networkGeneration; 302 | 303 | /// The mobile network generation: LTE, HSDPA, e.t.c 304 | final String? radioType; 305 | 306 | final String networkOperatorName; 307 | TelephonyInfo({ 308 | required this.networkCountryIso, 309 | required this.mobileCountryCode, 310 | required this.mobileNetworkCode, 311 | required this.displayName, 312 | required this.simState, 313 | required this.isoCountryCode, 314 | this.cellId, 315 | required this.phoneNumber, 316 | required this.carrierName, 317 | required this.subscriptionId, 318 | required this.networkGeneration, 319 | this.radioType, 320 | required this.networkOperatorName, 321 | }); 322 | 323 | TelephonyInfo copyWith({ 324 | String? networkCountryIso, 325 | String? mobileCountryCode, 326 | String? mobileNetworkCode, 327 | String? displayName, 328 | String? simState, 329 | String? isoCountryCode, 330 | CellId? cellId, 331 | String? phoneNumber, 332 | String? carrierName, 333 | int? subscriptionId, 334 | int? phoneCount, 335 | String? networkGeneration, 336 | String? radioType, 337 | String? networkOperatorName, 338 | }) { 339 | return TelephonyInfo( 340 | networkCountryIso: networkCountryIso ?? this.networkCountryIso, 341 | mobileCountryCode: mobileCountryCode ?? this.mobileCountryCode, 342 | mobileNetworkCode: mobileNetworkCode ?? this.mobileNetworkCode, 343 | displayName: displayName ?? this.displayName, 344 | simState: simState ?? this.simState, 345 | isoCountryCode: isoCountryCode ?? this.isoCountryCode, 346 | cellId: cellId ?? this.cellId, 347 | phoneNumber: phoneNumber ?? this.phoneNumber, 348 | carrierName: carrierName ?? this.carrierName, 349 | subscriptionId: subscriptionId ?? this.subscriptionId, 350 | networkGeneration: networkGeneration ?? this.networkGeneration, 351 | radioType: radioType ?? this.radioType, 352 | networkOperatorName: networkOperatorName ?? this.networkOperatorName, 353 | ); 354 | } 355 | 356 | Map toMap() { 357 | return { 358 | 'networkCountryIso': networkCountryIso, 359 | 'mobileCountryCode': mobileCountryCode, 360 | 'mobileNetworkCode': mobileNetworkCode, 361 | 'displayName': displayName, 362 | 'simState': simState, 363 | 'isoCountryCode': isoCountryCode, 364 | 'cellId': cellId?.toMap(), 365 | 'phoneNumber': phoneNumber, 366 | 'carrierName': carrierName, 367 | 'subscriptionId': subscriptionId, 368 | 'networkGeneration': networkGeneration, 369 | 'radioType': radioType, 370 | 'networkOperatorName': networkOperatorName, 371 | }; 372 | } 373 | 374 | factory TelephonyInfo.fromMap(Map map) { 375 | return TelephonyInfo( 376 | networkCountryIso: map['networkCountryIso'] ?? '', 377 | mobileCountryCode: map['mobileCountryCode'] ?? '', 378 | mobileNetworkCode: map['mobileNetworkCode'] ?? '', 379 | displayName: map['displayName'] ?? '', 380 | simState: map['simState'] ?? '', 381 | isoCountryCode: map['isoCountryCode'] ?? '', 382 | cellId: map['cellId'] != null ? CellId.fromMap(map['cellId']) : null, 383 | phoneNumber: map['phoneNumber'] ?? '', 384 | carrierName: map['carrierName'] ?? '', 385 | subscriptionId: map['subscriptionId'] ?? 0, 386 | networkGeneration: map['networkGeneration'] ?? '', 387 | radioType: map['radioType'], 388 | networkOperatorName: map['networkOperatorName'] ?? '', 389 | ); 390 | } 391 | 392 | String toJson() => json.encode(toMap()); 393 | 394 | factory TelephonyInfo.fromJson(String source) => 395 | TelephonyInfo.fromMap(json.decode(source)); 396 | 397 | @override 398 | String toString() { 399 | return 'TelephonyInfo(networkCountryIso: $networkCountryIso, mobileCountryCode: $mobileCountryCode, mobileNetworkCode: $mobileNetworkCode, displayName: $displayName, simState: $simState, isoCountryCode: $isoCountryCode, cellId: $cellId, phoneNumber: $phoneNumber, carrierName: $carrierName, subscriptionId: $subscriptionId, networkGeneration: $networkGeneration, radioType: $radioType, networkOperatorName: $networkOperatorName)'; 400 | } 401 | 402 | @override 403 | bool operator ==(Object other) { 404 | if (identical(this, other)) return true; 405 | 406 | return other is TelephonyInfo && 407 | other.networkCountryIso == networkCountryIso && 408 | other.mobileCountryCode == mobileCountryCode && 409 | other.mobileNetworkCode == mobileNetworkCode && 410 | other.displayName == displayName && 411 | other.simState == simState && 412 | other.isoCountryCode == isoCountryCode && 413 | other.cellId == cellId && 414 | other.phoneNumber == phoneNumber && 415 | other.carrierName == carrierName && 416 | other.subscriptionId == subscriptionId && 417 | other.networkGeneration == networkGeneration && 418 | other.radioType == radioType && 419 | other.networkOperatorName == networkOperatorName; 420 | } 421 | 422 | @override 423 | int get hashCode { 424 | return networkCountryIso.hashCode ^ 425 | mobileCountryCode.hashCode ^ 426 | mobileNetworkCode.hashCode ^ 427 | displayName.hashCode ^ 428 | simState.hashCode ^ 429 | isoCountryCode.hashCode ^ 430 | cellId.hashCode ^ 431 | phoneNumber.hashCode ^ 432 | carrierName.hashCode ^ 433 | subscriptionId.hashCode ^ 434 | networkGeneration.hashCode ^ 435 | radioType.hashCode ^ 436 | networkOperatorName.hashCode; 437 | } 438 | } 439 | 440 | class CellId { 441 | final int cid; 442 | final int lac; 443 | CellId({ 444 | required this.cid, 445 | required this.lac, 446 | }); 447 | 448 | CellId copyWith({ 449 | int? cid, 450 | int? lac, 451 | }) { 452 | return CellId( 453 | cid: cid ?? this.cid, 454 | lac: lac ?? this.lac, 455 | ); 456 | } 457 | 458 | Map toMap() { 459 | return { 460 | 'cid': cid, 461 | 'lac': lac, 462 | }; 463 | } 464 | 465 | factory CellId.fromMap(Map map) { 466 | return CellId( 467 | cid: map['cid'] ?? 0, 468 | lac: map['lac'] ?? 0, 469 | ); 470 | } 471 | 472 | String toJson() => json.encode(toMap()); 473 | 474 | factory CellId.fromJson(String source) => CellId.fromMap(json.decode(source)); 475 | 476 | @override 477 | String toString() => 'CellId(cid: $cid, lac: $lac)'; 478 | 479 | @override 480 | bool operator ==(Object other) { 481 | if (identical(this, other)) return true; 482 | 483 | return other is CellId && other.cid == cid && other.lac == lac; 484 | } 485 | 486 | @override 487 | int get hashCode => cid.hashCode ^ lac.hashCode; 488 | } 489 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | import 'package:carrier_info/carrier_info.dart'; 5 | import 'package:flutter/cupertino.dart'; 6 | import 'package:flutter/material.dart'; 7 | 8 | void main() { 9 | runApp(const MyApp()); 10 | } 11 | 12 | class MyApp extends StatefulWidget { 13 | const MyApp({super.key}); 14 | 15 | @override 16 | State createState() => _MyAppState(); 17 | } 18 | 19 | class _MyAppState extends State { 20 | IosCarrierData? _iosInfo; 21 | IosCarrierData? get iosInfo => _iosInfo; 22 | set iosInfo(IosCarrierData? iosInfo) { 23 | setState(() => _iosInfo = iosInfo); 24 | } 25 | 26 | AndroidCarrierData? _androidInfo; 27 | AndroidCarrierData? get androidInfo => _androidInfo; 28 | set androidInfo(AndroidCarrierData? carrierInfo) { 29 | setState(() => _androidInfo = carrierInfo); 30 | } 31 | 32 | @override 33 | void initState() { 34 | super.initState(); 35 | initPlatformState(); 36 | } 37 | 38 | // Platform messages are asynchronous, so we initialize in an async method. 39 | Future initPlatformState() async { 40 | // Platform messages may fail, so we use a try/catch PlatformException. 41 | try { 42 | if (Platform.isAndroid) androidInfo = await CarrierInfo.getAndroidInfo(); 43 | if (Platform.isIOS) iosInfo = await CarrierInfo.getIosInfo(); 44 | } catch (e) { 45 | print('Error getting carrier info: $e'); 46 | } 47 | 48 | // If the widget was removed from the tree while the asynchronous platform 49 | // message was in flight, we want to discard the reply rather than calling 50 | // setState to update our non-existent appearance. 51 | } 52 | 53 | @override 54 | Widget build(BuildContext context) { 55 | return Material( 56 | color: Colors.transparent, 57 | child: CupertinoApp( 58 | debugShowCheckedModeBanner: false, 59 | home: CupertinoPageScaffold( 60 | navigationBar: CupertinoNavigationBar( 61 | middle: const Text('Carrier Info example app'), 62 | border: Border.symmetric( 63 | horizontal: BorderSide( 64 | width: 0.5, 65 | color: CupertinoColors.systemGrey2.withOpacity(0.4), 66 | ), 67 | ), 68 | ), 69 | backgroundColor: CupertinoColors.lightBackgroundGray, 70 | child: Platform.isAndroid 71 | ? AndroidUI(androidInfo: androidInfo) 72 | : IosUI(iosInfo: iosInfo), 73 | ), 74 | ), 75 | ); 76 | } 77 | } 78 | 79 | class IosUI extends StatelessWidget { 80 | const IosUI({ 81 | super.key, 82 | this.iosInfo, 83 | }); 84 | 85 | final IosCarrierData? iosInfo; 86 | 87 | String formatIOSVersion(Map? versionDict) { 88 | if (versionDict == null) return 'Unknown'; 89 | 90 | final major = versionDict['majorVersion'] ?? 0; 91 | final minor = versionDict['minorVersion'] ?? 0; 92 | final patch = versionDict['patchVersion'] ?? 0; 93 | 94 | return '$major.$minor.$patch'; 95 | } 96 | 97 | @override 98 | Widget build(BuildContext context) { 99 | // Check if we're on iOS 16.0+ and show deprecation notice 100 | final versionInfo = 101 | iosInfo?.toMap()['_ios_version_info'] as Map?; 102 | final isDeprecated = versionInfo?['ctcarrier_deprecated'] as bool? ?? false; 103 | 104 | return ListView( 105 | children: [ 106 | const SizedBox(height: 20), 107 | 108 | // Show deprecation notice if on iOS 16.0+ 109 | if (isDeprecated) ...[ 110 | Container( 111 | margin: const EdgeInsets.all(15), 112 | padding: const EdgeInsets.all(15), 113 | decoration: BoxDecoration( 114 | color: CupertinoColors.systemYellow.withOpacity(0.1), 115 | borderRadius: BorderRadius.circular(8), 116 | border: Border.all( 117 | color: CupertinoColors.systemYellow.withOpacity(0.3), 118 | ), 119 | ), 120 | child: Column( 121 | crossAxisAlignment: CrossAxisAlignment.start, 122 | children: [ 123 | const Row( 124 | children: [ 125 | Icon( 126 | CupertinoIcons.exclamationmark_triangle, 127 | color: CupertinoColors.systemYellow, 128 | size: 16, 129 | ), 130 | SizedBox(width: 8), 131 | Text( 132 | 'iOS 16.0+ Limitation', 133 | style: TextStyle( 134 | fontWeight: FontWeight.bold, 135 | color: CupertinoColors.systemYellow, 136 | ), 137 | ), 138 | ], 139 | ), 140 | const SizedBox(height: 8), 141 | Text( 142 | versionInfo?['deprecation_notice'] as String? ?? 143 | 'CTCarrier is deprecated. Most carrier information is unavailable.', 144 | style: const TextStyle( 145 | fontSize: 13, 146 | color: CupertinoColors.systemGrey, 147 | ), 148 | ), 149 | ], 150 | ), 151 | ), 152 | ], 153 | 154 | // Device Status Section 155 | const Padding( 156 | padding: EdgeInsets.all(15), 157 | child: Text( 158 | 'DEVICE STATUS', 159 | style: TextStyle( 160 | fontSize: 15, 161 | color: CupertinoColors.systemGrey, 162 | ), 163 | ), 164 | ), 165 | 166 | HomeItem( 167 | title: 'SIM Inserted', 168 | value: '${iosInfo?.isSIMInserted ?? false}', 169 | isFirst: true, 170 | ), 171 | 172 | // iOS Version Info 173 | if (versionInfo != null) ...[ 174 | HomeItem( 175 | title: 'iOS Version', 176 | value: formatIOSVersion( 177 | versionInfo['ios_version'] as Map?), 178 | ), 179 | HomeItem( 180 | title: 'CTCarrier Deprecated', 181 | value: '${versionInfo['ctcarrier_deprecated'] ?? false}', 182 | ), 183 | ], 184 | 185 | // Network Status Section 186 | if (iosInfo?.networkStatus != null) ...[ 187 | const SizedBox(height: 20), 188 | const Padding( 189 | padding: EdgeInsets.all(15), 190 | child: Text( 191 | 'NETWORK STATUS', 192 | style: TextStyle( 193 | fontSize: 15, 194 | color: CupertinoColors.systemGrey, 195 | ), 196 | ), 197 | ), 198 | HomeItem( 199 | title: 'Has Cellular Data', 200 | value: '${iosInfo?.networkStatus?.hasCellularData ?? false}', 201 | isFirst: true, 202 | ), 203 | HomeItem( 204 | title: 'Active Services', 205 | value: '${iosInfo?.networkStatus?.activeServices ?? 0}', 206 | ), 207 | HomeItem( 208 | title: 'Technologies', 209 | value: (iosInfo?.networkStatus?.technologies?.isNotEmpty ?? false) 210 | ? iosInfo!.networkStatus!.technologies!.join(', ') 211 | : 'None', 212 | ), 213 | ], 214 | 215 | // Subscriber Information Section 216 | if (iosInfo?.subscriberInfo != null) ...[ 217 | const SizedBox(height: 20), 218 | const Padding( 219 | padding: EdgeInsets.all(15), 220 | child: Text( 221 | 'SUBSCRIBER INFORMATION', 222 | style: TextStyle( 223 | fontSize: 15, 224 | color: CupertinoColors.systemGrey, 225 | ), 226 | ), 227 | ), 228 | HomeItem( 229 | title: 'Subscriber Count', 230 | value: '${iosInfo?.subscriberInfo?.subscriberCount ?? 0}', 231 | isFirst: true, 232 | ), 233 | HomeItem( 234 | title: 'Subscriber IDs', 235 | value: (iosInfo?.subscriberInfo?.subscriberIdentifiers.isNotEmpty ?? 236 | false) 237 | ? iosInfo!.subscriberInfo!.subscriberIdentifiers.join(', ') 238 | : 'None', 239 | ), 240 | if (iosInfo?.subscriberInfo?.carrierTokens != null) 241 | HomeItem( 242 | title: 'Carrier Tokens', 243 | value: 244 | '${iosInfo?.subscriberInfo?.carrierTokens?.length ?? 0} tokens available', 245 | ), 246 | ], 247 | 248 | // Cellular Plan Information Section 249 | if (iosInfo?.cellularPlanInfo != null) ...[ 250 | const SizedBox(height: 20), 251 | const Padding( 252 | padding: EdgeInsets.all(15), 253 | child: Text( 254 | 'CELLULAR PLAN INFORMATION', 255 | style: TextStyle( 256 | fontSize: 15, 257 | color: CupertinoColors.systemGrey, 258 | ), 259 | ), 260 | ), 261 | HomeItem( 262 | title: 'Supports Embedded SIM', 263 | value: '${iosInfo?.cellularPlanInfo?.supportsEmbeddedSIM ?? false}', 264 | isFirst: true, 265 | ), 266 | ], 267 | 268 | // Legacy supportsEmbeddedSIM (for backward compatibility) 269 | if (iosInfo?.cellularPlanInfo == null && iosInfo != null) ...[ 270 | const SizedBox(height: 20), 271 | const Padding( 272 | padding: EdgeInsets.all(15), 273 | child: Text( 274 | 'LEGACY CARRIER INFORMATION', 275 | style: TextStyle( 276 | fontSize: 15, 277 | color: CupertinoColors.systemGrey, 278 | ), 279 | ), 280 | ), 281 | HomeItem( 282 | title: 'supportsEmbeddedSIM (Legacy)', 283 | value: '${iosInfo?.supportsEmbeddedSIM ?? false}', 284 | isFirst: true, 285 | ), 286 | ], 287 | 288 | // Radio Access Technology (still works on iOS 16.0+) 289 | if ((iosInfo?.carrierRadioAccessTechnologyTypeList ?? []) 290 | .isNotEmpty) ...[ 291 | const SizedBox(height: 20), 292 | const Padding( 293 | padding: EdgeInsets.all(15), 294 | child: Text( 295 | 'RADIO ACCESS TECHNOLOGY (Available on all iOS versions)', 296 | style: TextStyle( 297 | fontSize: 15, 298 | color: CupertinoColors.systemGrey, 299 | ), 300 | ), 301 | ), 302 | ...(iosInfo?.carrierRadioAccessTechnologyTypeList ?? []) 303 | .asMap() 304 | .entries 305 | .map( 306 | (entry) => HomeItem( 307 | title: 'Technology ${entry.key + 1}', 308 | value: entry.value, 309 | isFirst: entry.key == 0, 310 | ), 311 | ), 312 | ], 313 | 314 | // Carrier Data (limited on iOS 16.0+) 315 | if ((iosInfo?.carrierData ?? []).isNotEmpty) ...[ 316 | const SizedBox(height: 20), 317 | const Padding( 318 | padding: EdgeInsets.all(15), 319 | child: Text( 320 | 'CARRIER DATA', 321 | style: TextStyle( 322 | fontSize: 15, 323 | color: CupertinoColors.systemGrey, 324 | ), 325 | ), 326 | ), 327 | ...(iosInfo?.carrierData ?? []).asMap().entries.map( 328 | (entry) { 329 | final index = entry.key; 330 | final carrierData = entry.value; 331 | final carrierMap = carrierData.toMap(); 332 | 333 | return Column( 334 | children: [ 335 | if (index > 0) const SizedBox(height: 15), 336 | Padding( 337 | padding: const EdgeInsets.all(15), 338 | child: Row( 339 | children: [ 340 | Text( 341 | 'SIM ${index + 1}: ${carrierData.carrierName ?? 'Unknown'}', 342 | style: const TextStyle( 343 | fontSize: 15, 344 | color: CupertinoColors.systemGrey, 345 | ), 346 | ), 347 | if (isDeprecated) ...[ 348 | const SizedBox(width: 8), 349 | const Icon( 350 | CupertinoIcons.exclamationmark_triangle_fill, 351 | color: CupertinoColors.systemYellow, 352 | size: 14, 353 | ), 354 | ], 355 | ], 356 | ), 357 | ), 358 | ...carrierMap.entries.map( 359 | (e) { 360 | // Skip internal fields 361 | if (e.key.startsWith('_')) return const SizedBox.shrink(); 362 | 363 | // Highlight deprecated fields 364 | final isDeprecatedField = isDeprecated && 365 | [ 366 | 'carrierName', 367 | 'mobileCountryCode', 368 | 'mobileNetworkCode', 369 | 'isoCountryCode', 370 | 'carrierAllowsVOIP' 371 | ].contains(e.key); 372 | 373 | return HomeItem( 374 | title: e.key, 375 | value: e.value?.toString() ?? 'null', 376 | isDeprecated: isDeprecatedField, 377 | ); 378 | }, 379 | ), 380 | ], 381 | ); 382 | }, 383 | ), 384 | ], 385 | 386 | // Show a message if no data is available 387 | if (iosInfo == null) ...[ 388 | const SizedBox(height: 50), 389 | const Center( 390 | child: Column( 391 | children: [ 392 | Icon( 393 | CupertinoIcons.info_circle, 394 | size: 50, 395 | color: CupertinoColors.systemGrey, 396 | ), 397 | SizedBox(height: 16), 398 | Text( 399 | 'Loading carrier information...', 400 | style: TextStyle( 401 | fontSize: 16, 402 | color: CupertinoColors.systemGrey, 403 | ), 404 | ), 405 | ], 406 | ), 407 | ), 408 | ], 409 | 410 | const SizedBox(height: 20), 411 | ], 412 | ); 413 | } 414 | } 415 | 416 | class AndroidUI extends StatelessWidget { 417 | const AndroidUI({ 418 | super.key, 419 | this.androidInfo, 420 | }); 421 | 422 | final AndroidCarrierData? androidInfo; 423 | 424 | @override 425 | Widget build(BuildContext context) { 426 | return ListView( 427 | children: [ 428 | const SizedBox(height: 20), 429 | Column( 430 | crossAxisAlignment: CrossAxisAlignment.start, 431 | children: [ 432 | const Padding( 433 | padding: EdgeInsets.all(15), 434 | child: Text( 435 | 'CARRIER INFORMATION', 436 | style: TextStyle( 437 | fontSize: 15, 438 | color: CupertinoColors.systemGrey, 439 | ), 440 | ), 441 | ), 442 | HomeItem( 443 | title: 'isVoiceCapable', 444 | value: '${androidInfo?.isVoiceCapable ?? false}', 445 | isFirst: true, 446 | ), 447 | HomeItem( 448 | title: 'isSmsCapable', 449 | value: '${androidInfo?.isSmsCapable ?? false}', 450 | ), 451 | HomeItem( 452 | title: 'isMultiSimSupported', 453 | value: androidInfo?.isMultiSimSupported ?? 'Unknown', 454 | ), 455 | HomeItem( 456 | title: 'isDataCapable', 457 | value: '${androidInfo?.isDataCapable ?? false}', 458 | ), 459 | HomeItem( 460 | title: 'isDataEnabled', 461 | value: '${androidInfo?.isDataEnabled ?? false}', 462 | ), 463 | ...(androidInfo?.telephonyInfo ?? []).map((it) { 464 | return Padding( 465 | padding: const EdgeInsets.symmetric(vertical: 15), 466 | child: Column( 467 | children: [ 468 | Text( 469 | 'SIM: ${it.phoneNumber} (from telephonyInfo)', 470 | style: const TextStyle( 471 | fontSize: 15, 472 | color: CupertinoColors.systemGrey, 473 | ), 474 | ), 475 | const SizedBox(height: 15), 476 | ...(it.toMap()).entries.map( 477 | (val) => HomeItem( 478 | title: '${val.key}', 479 | value: '${val.value ?? 'N/A'}', 480 | ), 481 | ) 482 | ], 483 | ), 484 | ); 485 | }), 486 | ...(androidInfo?.subscriptionsInfo ?? []).map((it) { 487 | return Column( 488 | children: [ 489 | Text( 490 | 'SIM: ${it.phoneNumber} (from subscriptionsInfo)', 491 | style: const TextStyle( 492 | fontSize: 15, 493 | color: CupertinoColors.systemGrey, 494 | ), 495 | ), 496 | const SizedBox(height: 15), 497 | ...(it.toMap()).entries.map( 498 | (val) => HomeItem( 499 | title: '${val.key}', 500 | value: '${val.value ?? 'N/A'}', 501 | ), 502 | ) 503 | ], 504 | ); 505 | }), 506 | 507 | // Show a message if no data is available 508 | if (androidInfo == null) ...[ 509 | const SizedBox(height: 50), 510 | const Center( 511 | child: Column( 512 | children: [ 513 | Icon( 514 | CupertinoIcons.info_circle, 515 | size: 50, 516 | color: CupertinoColors.systemGrey, 517 | ), 518 | SizedBox(height: 16), 519 | Text( 520 | 'Loading carrier information...', 521 | style: TextStyle( 522 | fontSize: 16, 523 | color: CupertinoColors.systemGrey, 524 | ), 525 | ), 526 | ], 527 | ), 528 | ), 529 | ], 530 | ], 531 | ), 532 | ], 533 | ); 534 | } 535 | } 536 | 537 | class HomeItem extends StatelessWidget { 538 | final bool isFirst; 539 | final String title; 540 | final String? value; 541 | final bool isDeprecated; 542 | 543 | const HomeItem({ 544 | super.key, 545 | required this.title, 546 | this.value, 547 | this.isFirst = false, 548 | this.isDeprecated = false, 549 | }); 550 | 551 | @override 552 | Widget build(BuildContext context) { 553 | return Material( 554 | color: Colors.white, 555 | child: InkWell( 556 | onTap: () {}, 557 | child: Column( 558 | children: [ 559 | if (!isFirst) 560 | Container(height: 0.5, color: Colors.grey.withOpacity(0.3)), 561 | Padding( 562 | padding: const EdgeInsets.all(15), 563 | child: Row( 564 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 565 | children: [ 566 | Row( 567 | children: [ 568 | Text( 569 | title, 570 | style: TextStyle( 571 | color: 572 | isDeprecated ? CupertinoColors.systemGrey : null, 573 | ), 574 | ), 575 | if (isDeprecated) ...[ 576 | const SizedBox(width: 4), 577 | const Icon( 578 | CupertinoIcons.exclamationmark_triangle_fill, 579 | color: CupertinoColors.systemYellow, 580 | size: 12, 581 | ), 582 | ], 583 | ], 584 | ), 585 | const Spacer(), 586 | Flexible( 587 | child: Wrap( 588 | alignment: WrapAlignment.start, 589 | crossAxisAlignment: WrapCrossAlignment.start, 590 | children: [ 591 | Text( 592 | value ?? 'N/A', 593 | style: TextStyle( 594 | color: isDeprecated 595 | ? CupertinoColors.systemGrey 596 | : null, 597 | fontStyle: isDeprecated ? FontStyle.italic : null, 598 | ), 599 | ), 600 | ], 601 | ), 602 | ), 603 | ], 604 | ), 605 | ), 606 | ], 607 | ), 608 | ), 609 | ); 610 | } 611 | } 612 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 51; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 253EF363382A73633EE81226 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 653B2118F65BD2512155D3FB /* Pods_Runner.framework */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 15 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 16 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXCopyFilesBuildPhase section */ 20 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 21 | isa = PBXCopyFilesBuildPhase; 22 | buildActionMask = 2147483647; 23 | dstPath = ""; 24 | dstSubfolderSpec = 10; 25 | files = ( 26 | ); 27 | name = "Embed Frameworks"; 28 | runOnlyForDeploymentPostprocessing = 0; 29 | }; 30 | /* End PBXCopyFilesBuildPhase section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 34 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 35 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 36 | 653B2118F65BD2512155D3FB /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 38 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 40 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 41 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 42 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 44 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 45 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 46 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | BAC04C594C6EA30D3A943185 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 48 | D32F18ADDDA1A9631DD6BA11 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 49 | F8CF71CAD319A4B9091A27D4 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 253EF363382A73633EE81226 /* Pods_Runner.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | /* End PBXFrameworksBuildPhase section */ 62 | 63 | /* Begin PBXGroup section */ 64 | 201E9FBDB9FE7B544ACDE874 /* Pods */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | D32F18ADDDA1A9631DD6BA11 /* Pods-Runner.debug.xcconfig */, 68 | BAC04C594C6EA30D3A943185 /* Pods-Runner.release.xcconfig */, 69 | F8CF71CAD319A4B9091A27D4 /* Pods-Runner.profile.xcconfig */, 70 | ); 71 | path = Pods; 72 | sourceTree = ""; 73 | }; 74 | 3EEEA342012F73D1C85E842D /* Frameworks */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 653B2118F65BD2512155D3FB /* Pods_Runner.framework */, 78 | ); 79 | name = Frameworks; 80 | sourceTree = ""; 81 | }; 82 | 9740EEB11CF90186004384FC /* Flutter */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 86 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 87 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 88 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 89 | ); 90 | name = Flutter; 91 | sourceTree = ""; 92 | }; 93 | 97C146E51CF9000F007C117D = { 94 | isa = PBXGroup; 95 | children = ( 96 | 9740EEB11CF90186004384FC /* Flutter */, 97 | 97C146F01CF9000F007C117D /* Runner */, 98 | 97C146EF1CF9000F007C117D /* Products */, 99 | 201E9FBDB9FE7B544ACDE874 /* Pods */, 100 | 3EEEA342012F73D1C85E842D /* Frameworks */, 101 | ); 102 | sourceTree = ""; 103 | }; 104 | 97C146EF1CF9000F007C117D /* Products */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 97C146EE1CF9000F007C117D /* Runner.app */, 108 | ); 109 | name = Products; 110 | sourceTree = ""; 111 | }; 112 | 97C146F01CF9000F007C117D /* Runner */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 116 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 117 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 118 | 97C147021CF9000F007C117D /* Info.plist */, 119 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 120 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 121 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 122 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 123 | ); 124 | path = Runner; 125 | sourceTree = ""; 126 | }; 127 | /* End PBXGroup section */ 128 | 129 | /* Begin PBXNativeTarget section */ 130 | 97C146ED1CF9000F007C117D /* Runner */ = { 131 | isa = PBXNativeTarget; 132 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 133 | buildPhases = ( 134 | DA2402CD26A3B4D29C89838A /* [CP] Check Pods Manifest.lock */, 135 | 9740EEB61CF901F6004384FC /* Run Script */, 136 | 97C146EA1CF9000F007C117D /* Sources */, 137 | 97C146EB1CF9000F007C117D /* Frameworks */, 138 | 97C146EC1CF9000F007C117D /* Resources */, 139 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 140 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 141 | 6BC2CA91037E01BACBAD70EA /* [CP] Embed Pods Frameworks */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | ); 147 | name = Runner; 148 | productName = Runner; 149 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | 97C146E61CF9000F007C117D /* Project object */ = { 156 | isa = PBXProject; 157 | attributes = { 158 | LastUpgradeCheck = 1300; 159 | ORGANIZATIONNAME = ""; 160 | TargetAttributes = { 161 | 97C146ED1CF9000F007C117D = { 162 | CreatedOnToolsVersion = 7.3.1; 163 | LastSwiftMigration = 1100; 164 | }; 165 | }; 166 | }; 167 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 168 | compatibilityVersion = "Xcode 9.3"; 169 | developmentRegion = en; 170 | hasScannedForEncodings = 0; 171 | knownRegions = ( 172 | en, 173 | Base, 174 | ); 175 | mainGroup = 97C146E51CF9000F007C117D; 176 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 177 | projectDirPath = ""; 178 | projectRoot = ""; 179 | targets = ( 180 | 97C146ED1CF9000F007C117D /* Runner */, 181 | ); 182 | }; 183 | /* End PBXProject section */ 184 | 185 | /* Begin PBXResourcesBuildPhase section */ 186 | 97C146EC1CF9000F007C117D /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 191 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 192 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 193 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXResourcesBuildPhase section */ 198 | 199 | /* Begin PBXShellScriptBuildPhase section */ 200 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 201 | isa = PBXShellScriptBuildPhase; 202 | buildActionMask = 2147483647; 203 | files = ( 204 | ); 205 | inputPaths = ( 206 | ); 207 | name = "Thin Binary"; 208 | outputPaths = ( 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | shellPath = /bin/sh; 212 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 213 | }; 214 | 6BC2CA91037E01BACBAD70EA /* [CP] Embed Pods Frameworks */ = { 215 | isa = PBXShellScriptBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | ); 219 | inputFileListPaths = ( 220 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", 221 | ); 222 | name = "[CP] Embed Pods Frameworks"; 223 | outputFileListPaths = ( 224 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | shellPath = /bin/sh; 228 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 229 | showEnvVarsInLog = 0; 230 | }; 231 | 9740EEB61CF901F6004384FC /* Run Script */ = { 232 | isa = PBXShellScriptBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | ); 236 | inputPaths = ( 237 | ); 238 | name = "Run Script"; 239 | outputPaths = ( 240 | ); 241 | runOnlyForDeploymentPostprocessing = 0; 242 | shellPath = /bin/sh; 243 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 244 | }; 245 | DA2402CD26A3B4D29C89838A /* [CP] Check Pods Manifest.lock */ = { 246 | isa = PBXShellScriptBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | ); 250 | inputFileListPaths = ( 251 | ); 252 | inputPaths = ( 253 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 254 | "${PODS_ROOT}/Manifest.lock", 255 | ); 256 | name = "[CP] Check Pods Manifest.lock"; 257 | outputFileListPaths = ( 258 | ); 259 | outputPaths = ( 260 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 261 | ); 262 | runOnlyForDeploymentPostprocessing = 0; 263 | shellPath = /bin/sh; 264 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 265 | showEnvVarsInLog = 0; 266 | }; 267 | /* End PBXShellScriptBuildPhase section */ 268 | 269 | /* Begin PBXSourcesBuildPhase section */ 270 | 97C146EA1CF9000F007C117D /* Sources */ = { 271 | isa = PBXSourcesBuildPhase; 272 | buildActionMask = 2147483647; 273 | files = ( 274 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 275 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 276 | ); 277 | runOnlyForDeploymentPostprocessing = 0; 278 | }; 279 | /* End PBXSourcesBuildPhase section */ 280 | 281 | /* Begin PBXVariantGroup section */ 282 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 283 | isa = PBXVariantGroup; 284 | children = ( 285 | 97C146FB1CF9000F007C117D /* Base */, 286 | ); 287 | name = Main.storyboard; 288 | sourceTree = ""; 289 | }; 290 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 291 | isa = PBXVariantGroup; 292 | children = ( 293 | 97C147001CF9000F007C117D /* Base */, 294 | ); 295 | name = LaunchScreen.storyboard; 296 | sourceTree = ""; 297 | }; 298 | /* End PBXVariantGroup section */ 299 | 300 | /* Begin XCBuildConfiguration section */ 301 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ALWAYS_SEARCH_USER_PATHS = NO; 305 | CLANG_ANALYZER_NONNULL = YES; 306 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 307 | CLANG_CXX_LIBRARY = "libc++"; 308 | CLANG_ENABLE_MODULES = YES; 309 | CLANG_ENABLE_OBJC_ARC = YES; 310 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 311 | CLANG_WARN_BOOL_CONVERSION = YES; 312 | CLANG_WARN_COMMA = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 315 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 316 | CLANG_WARN_EMPTY_BODY = YES; 317 | CLANG_WARN_ENUM_CONVERSION = YES; 318 | CLANG_WARN_INFINITE_RECURSION = YES; 319 | CLANG_WARN_INT_CONVERSION = YES; 320 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 321 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 322 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 323 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 324 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 325 | CLANG_WARN_STRICT_PROTOTYPES = YES; 326 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 327 | CLANG_WARN_UNREACHABLE_CODE = YES; 328 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 329 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 330 | COPY_PHASE_STRIP = NO; 331 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 332 | ENABLE_NS_ASSERTIONS = NO; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | GCC_C_LANGUAGE_STANDARD = gnu99; 335 | GCC_NO_COMMON_BLOCKS = YES; 336 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 337 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 338 | GCC_WARN_UNDECLARED_SELECTOR = YES; 339 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 340 | GCC_WARN_UNUSED_FUNCTION = YES; 341 | GCC_WARN_UNUSED_VARIABLE = YES; 342 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 343 | MTL_ENABLE_DEBUG_INFO = NO; 344 | SDKROOT = iphoneos; 345 | SUPPORTED_PLATFORMS = iphoneos; 346 | TARGETED_DEVICE_FAMILY = "1,2"; 347 | VALIDATE_PRODUCT = YES; 348 | }; 349 | name = Profile; 350 | }; 351 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 352 | isa = XCBuildConfiguration; 353 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 354 | buildSettings = { 355 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 356 | CLANG_ENABLE_MODULES = YES; 357 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 358 | DEVELOPMENT_TEAM = 423FY3A7H6; 359 | ENABLE_BITCODE = NO; 360 | INFOPLIST_FILE = Runner/Info.plist; 361 | LD_RUNPATH_SEARCH_PATHS = ( 362 | "$(inherited)", 363 | "@executable_path/Frameworks", 364 | ); 365 | PRODUCT_BUNDLE_IDENTIFIER = com.chizi.example; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 368 | SWIFT_VERSION = 5.0; 369 | VERSIONING_SYSTEM = "apple-generic"; 370 | }; 371 | name = Profile; 372 | }; 373 | 97C147031CF9000F007C117D /* Debug */ = { 374 | isa = XCBuildConfiguration; 375 | buildSettings = { 376 | ALWAYS_SEARCH_USER_PATHS = NO; 377 | CLANG_ANALYZER_NONNULL = YES; 378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 379 | CLANG_CXX_LIBRARY = "libc++"; 380 | CLANG_ENABLE_MODULES = YES; 381 | CLANG_ENABLE_OBJC_ARC = YES; 382 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 383 | CLANG_WARN_BOOL_CONVERSION = YES; 384 | CLANG_WARN_COMMA = YES; 385 | CLANG_WARN_CONSTANT_CONVERSION = YES; 386 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 387 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 388 | CLANG_WARN_EMPTY_BODY = YES; 389 | CLANG_WARN_ENUM_CONVERSION = YES; 390 | CLANG_WARN_INFINITE_RECURSION = YES; 391 | CLANG_WARN_INT_CONVERSION = YES; 392 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 393 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 394 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 395 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 396 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 397 | CLANG_WARN_STRICT_PROTOTYPES = YES; 398 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 399 | CLANG_WARN_UNREACHABLE_CODE = YES; 400 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 401 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 402 | COPY_PHASE_STRIP = NO; 403 | DEBUG_INFORMATION_FORMAT = dwarf; 404 | ENABLE_STRICT_OBJC_MSGSEND = YES; 405 | ENABLE_TESTABILITY = YES; 406 | GCC_C_LANGUAGE_STANDARD = gnu99; 407 | GCC_DYNAMIC_NO_PIC = NO; 408 | GCC_NO_COMMON_BLOCKS = YES; 409 | GCC_OPTIMIZATION_LEVEL = 0; 410 | GCC_PREPROCESSOR_DEFINITIONS = ( 411 | "DEBUG=1", 412 | "$(inherited)", 413 | ); 414 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 415 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 416 | GCC_WARN_UNDECLARED_SELECTOR = YES; 417 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 418 | GCC_WARN_UNUSED_FUNCTION = YES; 419 | GCC_WARN_UNUSED_VARIABLE = YES; 420 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 421 | MTL_ENABLE_DEBUG_INFO = YES; 422 | ONLY_ACTIVE_ARCH = YES; 423 | SDKROOT = iphoneos; 424 | TARGETED_DEVICE_FAMILY = "1,2"; 425 | }; 426 | name = Debug; 427 | }; 428 | 97C147041CF9000F007C117D /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | ALWAYS_SEARCH_USER_PATHS = NO; 432 | CLANG_ANALYZER_NONNULL = YES; 433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 434 | CLANG_CXX_LIBRARY = "libc++"; 435 | CLANG_ENABLE_MODULES = YES; 436 | CLANG_ENABLE_OBJC_ARC = YES; 437 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 438 | CLANG_WARN_BOOL_CONVERSION = YES; 439 | CLANG_WARN_COMMA = YES; 440 | CLANG_WARN_CONSTANT_CONVERSION = YES; 441 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 442 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 443 | CLANG_WARN_EMPTY_BODY = YES; 444 | CLANG_WARN_ENUM_CONVERSION = YES; 445 | CLANG_WARN_INFINITE_RECURSION = YES; 446 | CLANG_WARN_INT_CONVERSION = YES; 447 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 448 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 449 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 450 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 451 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 452 | CLANG_WARN_STRICT_PROTOTYPES = YES; 453 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 454 | CLANG_WARN_UNREACHABLE_CODE = YES; 455 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 456 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 457 | COPY_PHASE_STRIP = NO; 458 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 459 | ENABLE_NS_ASSERTIONS = NO; 460 | ENABLE_STRICT_OBJC_MSGSEND = YES; 461 | GCC_C_LANGUAGE_STANDARD = gnu99; 462 | GCC_NO_COMMON_BLOCKS = YES; 463 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 464 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 465 | GCC_WARN_UNDECLARED_SELECTOR = YES; 466 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 467 | GCC_WARN_UNUSED_FUNCTION = YES; 468 | GCC_WARN_UNUSED_VARIABLE = YES; 469 | IPHONEOS_DEPLOYMENT_TARGET = 11.0; 470 | MTL_ENABLE_DEBUG_INFO = NO; 471 | SDKROOT = iphoneos; 472 | SUPPORTED_PLATFORMS = iphoneos; 473 | SWIFT_COMPILATION_MODE = wholemodule; 474 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 475 | TARGETED_DEVICE_FAMILY = "1,2"; 476 | VALIDATE_PRODUCT = YES; 477 | }; 478 | name = Release; 479 | }; 480 | 97C147061CF9000F007C117D /* Debug */ = { 481 | isa = XCBuildConfiguration; 482 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 483 | buildSettings = { 484 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 485 | CLANG_ENABLE_MODULES = YES; 486 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 487 | DEVELOPMENT_TEAM = 423FY3A7H6; 488 | ENABLE_BITCODE = NO; 489 | INFOPLIST_FILE = Runner/Info.plist; 490 | LD_RUNPATH_SEARCH_PATHS = ( 491 | "$(inherited)", 492 | "@executable_path/Frameworks", 493 | ); 494 | PRODUCT_BUNDLE_IDENTIFIER = com.chizi.example; 495 | PRODUCT_NAME = "$(TARGET_NAME)"; 496 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 497 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 498 | SWIFT_VERSION = 5.0; 499 | VERSIONING_SYSTEM = "apple-generic"; 500 | }; 501 | name = Debug; 502 | }; 503 | 97C147071CF9000F007C117D /* Release */ = { 504 | isa = XCBuildConfiguration; 505 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 506 | buildSettings = { 507 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 508 | CLANG_ENABLE_MODULES = YES; 509 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 510 | DEVELOPMENT_TEAM = 423FY3A7H6; 511 | ENABLE_BITCODE = NO; 512 | INFOPLIST_FILE = Runner/Info.plist; 513 | LD_RUNPATH_SEARCH_PATHS = ( 514 | "$(inherited)", 515 | "@executable_path/Frameworks", 516 | ); 517 | PRODUCT_BUNDLE_IDENTIFIER = com.chizi.example; 518 | PRODUCT_NAME = "$(TARGET_NAME)"; 519 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 520 | SWIFT_VERSION = 5.0; 521 | VERSIONING_SYSTEM = "apple-generic"; 522 | }; 523 | name = Release; 524 | }; 525 | /* End XCBuildConfiguration section */ 526 | 527 | /* Begin XCConfigurationList section */ 528 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 529 | isa = XCConfigurationList; 530 | buildConfigurations = ( 531 | 97C147031CF9000F007C117D /* Debug */, 532 | 97C147041CF9000F007C117D /* Release */, 533 | 249021D3217E4FDB00AE95B9 /* Profile */, 534 | ); 535 | defaultConfigurationIsVisible = 0; 536 | defaultConfigurationName = Release; 537 | }; 538 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 539 | isa = XCConfigurationList; 540 | buildConfigurations = ( 541 | 97C147061CF9000F007C117D /* Debug */, 542 | 97C147071CF9000F007C117D /* Release */, 543 | 249021D4217E4FDB00AE95B9 /* Profile */, 544 | ); 545 | defaultConfigurationIsVisible = 0; 546 | defaultConfigurationName = Release; 547 | }; 548 | /* End XCConfigurationList section */ 549 | }; 550 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 551 | } 552 | --------------------------------------------------------------------------------