Meteor login DDP and Subscribe data with id login in Nativescript


#1

I’ve tried to connect with DDP and login. The result is a SUCCESS by getting token.

dpclient.call( 'login', [{password:appSettings.getString("password"),user:{username:appSettings.getString("user")}}],
        function (err, result) {
            if (err) {
                dialogs.alert(err).then(()=> {
                    console.log("Dialog closed!");
                });
                return;
            } else {
                appSettings.setString("token", result.token);
            }
        }
    );

Other server side, i have Meteor Publish :

Meteor.publish('CollectionsXXX', function (sFILTER, iLIMIT) {
	var iLIMIT = iLIMIT || 100;
	var sFILTER = sFILTER || {};
	if(this.userId) {
		return CollectionsXXX.find(sFILTER, {limit: iLIMIT});
	}
});

SUBSCRIBE OVER DDP :

ddpclient.subscribe(
            'CollectionsXXX', // name of Meteor Publish function to subscribe to
            [],        // any parameters used by the Publish function
            function () {
                var observArray = new observableArray.ObservableArray();
                for (var _id in ddpclient.collections. CollectionsXXX) {
                    var dataCall = ddpclient.collections. CollectionsXXX[_id];
                    observArray.push(dataCall);
                    console.log(dataCall);
                }
                arrayObserv.set('colXXX', observArray);
            }); 

If I am SUBSCRIBE from METEOR CLIENT all work well, but if i am SUBSCRIBE from DDP CLIENT i cant get data.

Are ddp.login not work ? or i have wrong SUBSCRIBE over DDP ?
Thanks