搜索插件、代码仓与 APP 分类

插件详情v0.0.4

esim

Flutter 插件,用于检查 eSIM 兼容性。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
45
喜欢数
38
Pub 分数
115

安装插件

flutter pub add esim

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

esim 包是一个 Flutter 插件,旨在检查 Android 和 iOS 设备上的 eSIM 兼容性。它为开发者提供了一种简单的方法来确定设备是否支持 eSIM 功能,从而让应用程序能够根据硬件功能调整特性。该插件兼容多个平台,包括 Web、macOS、Windows 和 Linux,尽管其主要用途是在移动操作系统上。它通过平台通道利用原生 API 来提供准确的设备信息。此工具非常适合依赖蜂窝网络连接或提供 eSIM 配置服务的应用程序。

适合场景

  • 在运行时检查设备 eSIM 支持
  • 在应用中启用 eSIM 特定功能
  • 为支持eSIM的设备提供用户指南
  • 在移动应用中集成eSIM设置流程
  • 支持运营商配置工具

主要特点

  • 跨平台兼容性
  • eSIM 状态检查的简单 API
  • 原生支持 Android 和 iOS
  • 返回设备eSIM功能状态
  • 适用于 Web、macOS、Windows 和 Linux

适合对象

  • 移动应用开发者构建连接功能
  • 需要eSIM配置的App
  • 面向多平台部署的开发者
  • 用于运营商或设备兼容性评估的工具
  • 专注于数字SIM管理的应用

使用建议

  • 非移动平台功能受限
  • eSIM 的可用性取决于设备制造商
  • 不支持运行时eSIM激活
  • 平台特定的行为可能有所不同
  • Android 和 iOS 需要正确的权限

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

flutter_esim

This project contains the steps and information needed to check if your iOS device is compatible with eSIM technology. eSIM, or Embedded SIM, is a new type of SIM card that is embedded within the device itself, rather than being a physical card that can be inserted and removed. This allows for more flexibility in activating and switching between different mobile plans.

Compatibility Check:

You can integrate eSIM functionality into your iOS app, please follow these steps:

Step 1:

Request for eSIM entitlement using your developer account.

Step 2:

Apple will approve the entitlement after some time. You can check if Apple has approved the entitlement from your app profile setting

Step 3:

Download the App Dev and Distribution profile (By selecting eSIM entitlement as Step #2).

Step 4:

Update your Info.plist with below keys and value

<key>CarrierDescriptors</key>
<array>
<dict>
<key>GID1</key>
<string>***</string>
<key>GID2</key>
<string>***</string>
<key>MCC</key> //Country Code
<string>***</string>
<key>MNC</key> //Network Code
<string>***</string>
</dict>
</array>

You can find GID1, GID2, MCC, and MNC for eSIM compatibility from the following sources:

Mobile network operators -

You can contact your mobile network operator and ask for the GID1, GID2, MCC, and MNC for your specific eSIM card. Online eSIM providers - Many online eSIM providers, such as Truphone, Twilio, and Unlocator, will provide the GID1, GID2, MCC, and MNC for their eSIM cards on their websites. Device manufacturers - Some device manufacturers, such as Apple and Samsung, will provide the GID1, GID2, MCC, and MNC for their eSIM-compatible devices on their website or in the device's user manual. eSIM databases - There are online databases, such as esimdb.com, that provide information on eSIM cards and their GID1, GID2, MCC, and MNC.

It is important to note that eSIM compatibility can vary depending on the mobile network operator and device, so it is important to check with the specific provider or manufacturer for the most accurate information.

Step 5:

Add eSIM compatibility code to AppDelegate file.

main.dart
class MyApp extends StatefulWidget {
  @override
  MyAppState createState() => MyAppState();
}

class _MyAppState extends State<MyApp> {
  int isEsimCompatible = 0;

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> checkEsimCompatibility() async {
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      isEsimCompatible = await Esim.isEsim();
    } on PlatformException {
      debugPrint('Failed to get esim compatibility.');
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('eSIM Compatibility example'),
        ),
        body: Center(
          child: ElevatedButton(
            onPressed: () async {
              await checkEsimCompatibility();
              Fluttertoast.showToast(
                  msg: isEsimCompatible == 1
                      ? "This device supports eSIM "
                      : 'This device does not supports eSIM',
                  toastLength: Toast.LENGTH_LONG,
                  gravity: ToastGravity.BOTTOM,
                  timeInSecForIosWeb: 1,
                  backgroundColor: Colors.grey,
                  textColor: Colors.white,
                  fontSize: 16.0);
            },
            child: const Text("Check eSIM compatibility"),
          ),
        ),
      ),
    );
  }
}

Upcoming features

  • eSIM compatibility for Android
  • eSIM installation for iOS and Android

Conclusion

With these steps, you can now check if your iOS device is compatible with eSIM, activate eSIM and switch between eSIM and physical SIM.

Referral link:

https://developer.apple.com/documentation/coretelephony?changes=latest_minor

所属分类

依赖

依赖清单 1 项

  • plugin_platform_interface^2.0.2

源码仓库

使用此插件的项目

暂无相关数据。