WL.JsonStore未初始化,试图在Android设备和Android模拟器中构建cordova IBM Mobile First应用程序

问题描述 投票:1回答:1

我遵循以下链接

https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/application-development/jsonstore/cordova/#adding-jsonstore

我还添加了JsonStore插件

尝试初始化Cordova Mobile First应用程序时,Wl.jsonStore未初始化

 WL.JSONStore.init(collections).then(function (collections) {                
    alert("collections creted sucessfully");
     console.log("Collections created sucessfully");
    // handle success - collection.people (people's collection)
                                            }).fail(function 
    (error) {
alert(error);
     console.log(error);// handle failure                                       });

WL.Store需要初始化。 Kinldy帮我解决这个问题。

enter image description here

javascript ibm-mobilefirst jsonstore
1个回答
0
投票

最后,我在IBM TroubleShoot站点找到了答案

请参阅链接:

https://mobilefirstplatform.ibmcloud.com/tutorials/ru/foundation/8.0/troubleshooting/jsonstore/

在config.xml中,将clientCustomInit属性更改为true。在index.js文件中:在文件的开头添加以下行:

document.addEventListener('mfpjsonjsloaded', initWL, false);

在wlCommonInit()中保留WL.JSONStore.init调用

添加以下功能:

function initWL(){                                                     
  var options = typeof wlInitOptions !== 'undefined' ? wlInitOptions
  : {};                                                                
  WL.Client.init(options);                                           
}   
© www.soinside.com 2019 - 2024. All rights reserved.