(eSIM Integration iOS)如何使用受限制的API"addPlan"启用iOS设备中的e-sim配置文件 [英] (eSIM Integration iOS) How to use restricted API "addPlan" to enable e-sim profile in iOS device

查看:415
本文介绍了(eSIM Integration iOS)如何使用受限制的API"addPlan"启用iOS设备中的e-sim配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在所有地方搜索之后,我发现可以使用以下API在iPhone中添加eSIM

After searching everywhere I found there is a way to add eSIM in iPhone using the following API

func addPlan(with: CTCellularPlanProvisioningRequest, completionHandler: (CTCellularPlanProvisioningAddPlanResult) -> Void)

我不知道为什么,但是完成处理程序不返回 CTCellularPlanProvisioningAddPlanResult 的结果,只是打印以下错误.

I don't know why but completion handler not returning the result of CTCellularPlanProvisioningAddPlanResult just printing the following error.

Domain=NSCocoaErrorDomain Code=4099 "The connection to service named
com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo=
{NSDebugDescription=The connection to service named
com.apple.commcenter.coretelephony.xpc was invalidated.

我想知道此API的工作原理,您可以在下面查看我的代码

I want to know how this API works, You can see my code below

let ctpr = CTCellularPlanProvisioningRequest()
ctpr.address = "SMDP+"
ctpr.confirmationCode = ""
ctpr.eid = ""
ctpr.iccid = ""

let ctcp =  CTCellularPlanProvisioning()
ctcp.addPlan(with: ctpr) { (result) in
    print(result)
}

我正在使用CoreTelephony框架

I am using CoreTelephony framework

任何帮助都会被申请

在检查了其他应用程序后,我发现GigSky在执行相同的操作,有人知道他们的执行情况吗?

After checking other apps I found that GigSky is doing the same, anyone knows how they are doing?

更新:

截至目前,我在下面找到了权利请求URL检查

As of now I found the entitlement request URL check below

https://developer.apple.com//contact/request/esim-access-entitlement

我要求但苹果没有回应.

I requested but apple is not responding.

推荐答案

通过此过程,您可以将eSIM功能集成到iOS应用中.

With this process, you can integrate eSIM functionality into your iOS app.

第1步

使用您的开发者帐户请求eSIM权利 从此处请求

Request for eSIM entitlement using your developer account Request from here

第2步

苹果将在一段时间后批准该权利(对我而言,这花费了几个月的时间) 您可以从应用程序配置文件设置中检查Apple是否已批准该权利

Apple will approve the entitlement after some time (For me it took months) You can check if Apple has approved the entitlement from your app profile setting

第3步

下载App Dev and Distribution配置文件(通过选择eSIM权利作为步骤2).

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

第4步

使用以下键和值更新您的 info.plist

Update your info.plist with below keys and value

<key>com.apple.security.network.server</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.CommCenter.fine-grained</key>
<array>
    <string>spi</string>
    <string>sim-authentication</string>
    <string>identity</string>
</array>
<key>com.apple.wlan.authentication</key>
<true/>
<key>keychain-access-groups</key>
<array>
    <string>apple</string>
    <string>com.apple.identities</string>
    <string>com.apple.certificates</string>
</array>
<key>com.apple.private.system-keychain</key>
<true/>

第5步(可以是可选的)

使用下面的键和值更新您的 {appname} .entitlements

Update your {appname}.entitlements with below key and value

<key>com.apple.CommCenter.fine-grained</key>
<array>
    <string>public-cellular-plan</string>
</array> 

第6步代码以添加eSIM个人资料

Step 6 Code to Add eSIM profile

 let ctpr = CTCellularPlanProvisioningRequest()
 let ctpr = CTCellularPlanProvisioningRequest()
 ctpr.address = "Your eSIM profile address"
 ctpr.matchingID = "Confirmation id"

 if #available(iOS 12.0, *) {
        let ctcp =  CTCellularPlanProvisioning()
        ctcp.addPlan(with: ctpr) { (result) in
            switch result {
            case .unknown:
                self.showGenericSingleButtonCustomAlert(description: "Sorry unknown error")
            case .fail:
                self.showGenericSingleButtonCustomAlert(description: "Oops! something went wrong")
            case .success:
                self.showGenericSingleButtonCustomAlert(description: "Yay! eSIM installed successfully")
            @unknown default:
                self.showGenericSingleButtonCustomAlert(description: "Oops! something went wrong")
            }
        }
    }

这篇关于(eSIM Integration iOS)如何使用受限制的API"addPlan"启用iOS设备中的e-sim配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆