search

Home  >  Q&A  >  body text

weex中打包js到原生android中调用weex.config.bundleUrl无效

各位好!本人使用Weex开发app,在weex提供的Playground里面可以获取到当前的bundleUrl,调用方式:
weex.config.bundleUrl或者this.$getConfig().bundleUrl。但是当把js打包到原生android里面的时候,发现没有bundleUrl了,只有env对象。请问各位该如何处理?

PHPzPHPz2891 days ago1000

reply all(1)I'll reply

  • 阿神

    阿神2017-04-18 09:17:50

    You need to take a look at the render method in WXSDKInstance, which can be obtained by render方法,playground可以获取到,是因为在调用该方法时,设置了optionsplayground

    because the options parameter is set when calling this method.

            Map<String, Object> options = new HashMap<>();
            options.put(WXSDKInstance.BUNDLE_URL, source);
            mInstance.render(
                    getPageName(),
                    template,
                    options,
                    jsonInitData,
                    WXRenderStrategy.APPEND_ASYNC);

    Similar to the pseudocode above. 🎜

    reply
    0
  • Cancelreply