Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS打开本地预置离线包,一直打开失败。 #21

Open
Hanrovey opened this issue Sep 10, 2019 · 1 comment
Open

iOS打开本地预置离线包,一直打开失败。 #21

Hanrovey opened this issue Sep 10, 2019 · 1 comment

Comments

@Hanrovey
Copy link

Hanrovey commented Sep 10, 2019

参考官网代码链接:https://tech.antfin.com/docs/2/133648

1、初始化容器代码:

// 自定义jsapi路径和预置离线包信息
let presetApplistPath = Bundle.main.path(forResource: "BCSCustomPresetApps.bundle/h5_json.json", ofType: nil)
let appPackagePath = Bundle.main.path(forResource: "BCSCustomPresetApps.bundle", ofType: nil)
let pluginsJsapisPath = Bundle.main.path(forResource: "BCSCustomPlugins.bundle/Poseidon-UserDefine-Extra-Config.plist", ofType: nil)
MPNebulaAdapterInterface.initNebula(withCustomPresetApplistPath: presetApplistPath!, customPresetAppPackagePath: appPackagePath!, customPluginsJsapisPath: pluginsJsapisPath!)


// 定制容器
MPNebulaAdapterInterface.shareInstance().nebulaVeiwControllerClass = H5WebViewController.self
MPNebulaAdapterInterface.shareInstance().nebulaUserAgent = "mPaaS/Portal"
MPNebulaAdapterInterface.shareInstance().nebulaNeedVerify = false

// 更新离线包
MPNebulaAdapterInterface.shareInstance().requestAllNebulaApps { (data, error) in
    //            debugPrint("[mpaas] nebula rpc data : \(data)")
    debugPrint(data)
}

2、预置离线包配置Bundle信息:
屏幕快照 2019-09-10 上午11 29 52

3、打开预置离线包代码:

    // MARK: 预置离线包i
    @objc func openPresetPackage(_ sender: UIButton) {
        MPNebulaAdapterInterface.shareInstance().startH5ViewController(withNebulaApp: ["appId": "20190901"])
    }

4、报错页面
IMG_0151

@Hanrovey Hanrovey changed the title iOS本地预置离线,一直打开失败。 iOS打开本地预置离线包,一直打开失败。 Sep 10, 2019
@vivi23vivi
Copy link

预置资源包加载失败一般为预置包版本和包信息不匹配,测试本地预置离线包时,请先断开网络,避免离线包有更新,确保加载的是客户端本地预置的版本。

检查本地预置的离线包信息与 Plist 中配置的包信息是否一致,包括 appID、version、main_url 等信息。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants