Titanium JIRA Archive
Appcelerator Community (AC)

[AC-902] ACS show_user_like not returning when use with "where" parameter.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-09-30T01:02:11.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy
Labelsapi
Reporterheedoo moon
AssigneeShak Hossain
Created2015-04-13T16:14:07.000+0000
Updated2016-03-08T07:37:12.000+0000

Description

When I use ACS Custom Object query "show_user_like : true", it suppose to return "current_user_liked". But if I use query with where parameter, it's not returning "current_user_liked". (it works without "where").

Comments

  1. Rakhi Mitro 2015-08-23

    Hello [~heedoo], We tested your issue in our environment. Here is my sample code. ACS show_user_like return true when use with "where" parameter. Can you Please attach your test code,logs & let us know. *Test Environments:* CLI Version = 4.0.1 Titanium SDK Version = 4.1.0.GA Android: Google Galaxy Nexus - 4.1.1 - API 16 - 720x1280 Appc Studio: Appcelerator Studio, build: 4.1.0.201507140915 *Test Code:* *index.js*
       function doClick(e){
       
       (function() {
       		var ACS = require('ti.cloud'),
       		    env = Ti.App.deployType.toLowerCase() === 'production' ? 'production' : 'development',
       		    username = Ti.App.Properties.getString('acs-username-' + env),
       		    password = Ti.App.Properties.getString('acs-password-' + env);
       
       		// if not configured, just return
       		if (!env || !username || !password) {
       			return;
       		}
       		/**
       		 * Appcelerator Cloud (ACS) Admin User Login Logic
       		 *
       		 * fires login.success with the user as argument on success
       		 * fires login.failed with the result as argument on error
       		 */
       
       		//username='rakhimonimitro';
       		//password='rakhimonimitro';
       
       		ACS.Users.login({
       			login : username,
       			password : password,
       		}, function(result) {
       			if (env === 'development') {
       				Ti.API.info('ACS Login Results for environment ' + env + ':');
       				//Ti.API.info(result);
       
       			}
       			if (result && result.success && result.users && result.users.length) {
       				Ti.App.fireEvent('login.success', result.users[0], env);
       				
       				ACS.Objects.create({
       				    classname: 'cars',
       				    fields: {
       				        make: 'nissan',
       				        color: 'blue',
       				        show_user_like: 'true'
       				    }
       				}, function (e) {
       				    if (e.success) {
       				        var car = e.cars[0];
       				        alert('Success:\n' +
       				            'id: ' + car.id + '\n' +
       				            'make: ' + car.make + '\n' +
       				            'color: ' + car.color + '\n' +
       				            'year: ' + car.year + '\n' +
       				            'show_user_like: ' + car.show_user_like);
       				    } else {
       				        alert('Error:\n' +
       				            ((e.error && e.message) || JSON.stringify(e)));
       				    }
       				});
       			
       		
       			} else {
       				Ti.App.fireEvent('login.failed', result, env);
       			}
       		});
       
       	})();
       }
       $.index.open();
       
       
    *index.xml*
       <Alloy>
       	<Window class="container">
       		<Label id="label" onClick="doClick">Hello, World</Label>
       	</Window>
       </Alloy>
       
    Thanks

JSON Source