ibm-mobilefirstjsonstore

JSON Store is not creating in Android for latest version fix pack 7.1.0.00.20160919-1656


Below sample code is not working in latest fix on Android but if we remove the password field from options then it's working fine. We are getting below error on Android but it's working fine on IOS

{"src":"initCollection","err":-3,"msg":"INVALID_KEY_ON_PROVISION","col":"people","usr":"test","doc":{},"res":{}}

function wlCommonInit(){
    /*
     * Use of WL.Client.connect() API before any connectivity to a MobileFirst Server is required. 
     * This API should be called only once, before any other WL.Client methods that communicate with the MobileFirst Server.
     * Don't forget to specify and implement onSuccess and onFailure callback functions for WL.Client.connect(), e.g:
     *    
     *    WL.Client.connect({
     *          onSuccess: onConnectSuccess,
     *          onFailure: onConnectFailure
     *    });
     *     
     */

    // Common initialization code goes here

}


function onClick(){
    alert("Click");
    var collectionName = 'people';

    // Object that defines all the collections.
    var collections = {

      // Object that defines the 'people' collection.
      people : {

        // Object that defines the Search Fields for the 'people' collection.
        searchFields : {name: 'string', age: 'integer'}
      }
    };

    // Optional options object.
    var options = {

       username:"test",
      // Optional password, default no passw`enter code here`ord.
      password : '123',

    };

    WL.JSONStore.init(collections, options)

    .then(function () {
        alert("Success in jstore");
    })



    .fail(function (errorObject) {
       // Handle failure for any of the previous JSONStore operations (init, add).
        alert("Failure in jstore : "+ JSON.stringify(errorObject));
    });
};

Solution

  • Update: The iFix is now released. Build number is 7.1.0.0-IF201610060540 .

    This is a known issue with the latest available iFix. It has been recently fixed and should be available soon.

    Keep an eye out for a newer iFix release in the IBM Fix Central website for a fix for this issue.