Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20421] ti.cloud module methods are not responding on MobileWeb when building from Windows

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionWon't Fix
Resolution Date2017-06-29T18:51:15.000+0000
Affected Version/sRelease 5.1.2, Release 5.1.1
Fix Version/sn/a
ComponentsMobileWeb
Labelsmobileweb, windows
Reporter Ricardo Ramirez
AssigneeChris Barber
Created2016-02-17T20:58:18.000+0000
Updated2018-04-04T23:20:20.000+0000

Description

Issue Description

Can't get response from ti.cloud module methods running as mobile web preview in browser on windows environment, the same code running from a Mac OS system is working as expected.

Steps to reproduce

Create a new classic default project application on studio with cloud services enabled

Replace the code inside app.js with the next simple test case:

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();


//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'Tab 1',
    backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'Tab 1',
    window:win1
});

var label1 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 1',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

win1.add(label1);

//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({  
    title:'Tab 2',
    backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({  
    icon:'KS_nav_ui.png',
    title:'Tab 2',
    window:win2
});

var label2 = Titanium.UI.createLabel({
	color:'#999',
	text:'I am Window 2',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

win2.add(label2);



//
//  add tabs
//
tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);  


// open tab group
tabGroup.open();


// added during app creation. this will automatically login to
// ACS for your application and then fire an event (see below)
// when connected or errored. if you do not use ACS in your
// application as a client, you should remove this block
(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
 */
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);
		alert(JSON.stringify(result));
	}
	if (result && result.success && result.users && result.users.length){
		Ti.App.fireEvent('login.success',result.users[0],env);
	} else {
		Ti.App.fireEvent('login.failed',result,env);
	}
});

})();

The alert or Ti info's from the ACS variable are not executed on windows.

Comments

  1. Christopher Williams 2016-02-17

    This is a MobileWeb/Studio issue, not a Windows SDK issue. I'm not sure if the bug is in the MobileWeb SDK (if it is, then that'd be [~cbarber]'s ticket); or in Studio for whatever browser/webserver the IDE is using/starting (then it'd be [~kkolipaka]'s ticket in TISTUD)
  2. Christopher Williams 2016-02-17

    [~rramirez] It'd be pretty easy to try and narrow this down by trying to run the app from the CLI (outside Studio) and see if the bug persists. If so, then it's likely an issue in MobileWeb or maybe even the ACS cloud module. If it _only_ happens inside Studio, then it's a Studio ticket.
  3. Ewan Harris 2016-03-02

    I can reproduce this issue using Windows 10 Pro Appc NPM: 4.2.3 Appc Core: 5.2.0 Ti SDK: 5.2.0.GA, 5.1.2.GA Appcelerator Studio: 4.5.0.201602170821 When building from both Studio and the CLI on Windows for MobileWeb there are no alerts show, additionally there the following error in the browser console Uncaught TypeError: Cannot read property 'login' of undefined. The ti.cloud module appears to be copied to the build folder just fine, it is seen in the build/mobileweb/modules/ti.cloud folder This appears to be a MobileWeb specific issue as the following platforms, built on Windows, work as expected(that is an alert is shown with the login information): * Android emulator * Android device * Windows Phone emulator * Windows Phone device * Winstore local
  4. Lee Morris 2017-06-29

    Resolving as "Won't Fix" as MobileWeb has been deprecated.
  5. Eric Merriman 2018-04-04

    Closing as will not fix.

JSON Source