Titanium JIRA Archive
Appcelerator Community (AC)

[AC-751] Can't use ti.cloud in mobileweb app

GitHub Issuen/a
TypeBug
Priorityn/a
StatusResolved
ResolutionCannot Reproduce
Resolution Date2015-09-30T00:58:03.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy, Appcelerator Modules, Titanium SDK & CLI
Labelsexports, mobileweb, ti.cloud
ReporterNicolas Weinachter
AssigneeShak Hossain
Created2015-04-12T22:37:07.000+0000
Updated2016-03-08T07:37:00.000+0000

Description

Hello, When I compile my code as mobile web, the ti.cloud parts doesn't work. When launching the app in the browser, there are errors in the javascript console : exports is not defined Cloud.sendRequest is not a function The app is working fine on android. I tried different sdk or ti.cloud version but there is always the same error. Thank you, Nicolas.

Attachments

FileDateSize
build.rar2015-04-12T22:37:07.000+00001451286

Comments

  1. Rakhi Mitro 2015-08-23

    Hello, We tested this issue in our environment. Its working as expected. I will mark this as resolved we can't reproduce it. Test Environment: CLI Version = 4.0.1 Titanium SDK Version = 4.1.0.GA Google Chrome 44.0.2403.157 (64-bit) *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);
       		ACS.sendRequest({
       		    url : "users/login.json",
       		    method : "POST",
       		    data : {
       		        login : 'rakhimonimitro@gmail.com',
       		        password : 'test1234'
       		    }
       		}, function(e) {// The callback called when the request completes
       		    if (e.success) {
       		        var user = e.users[0];
       		        alert('Success:\n' + 
       		            'id: ' + user.id + '\n' + 
       		            'first name: ' + user.first_name + '\n' + 
       		            'last name: ' + user.last_name);
       		    } else {
       		        alert('Error:\n' + ((e.error && e.message) || JSON.stringify(e)));
       		    }
       		});     
       
       	})();
       }
       
       $.index.open();
       
    Thanks

JSON Source