Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17354] iOS: Stuck in KitchenSink Facebook Query Example

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionInvalid
Resolution Date2017-05-02T20:33:34.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
LabelsKitchenSink, TCSupport, qe-3.4.0
ReporterGeoffrey Hoffman
AssigneeEric Merriman
Created2014-06-17T23:29:00.000+0000
Updated2017-05-02T20:33:34.000+0000

Description

Problem Description

If you execute the FB Query example in the KitchenSink (after logging into Facebook) your friends are pulled into the app, but I couldn't figure out a way to escape that view without rebuilding the app from TIS. There may be a way; I didn't try for very long.

TESTING ENVIRONMENT:

Mac OS X 10.9 Ti CLI 3.3.0 Titanium SDK: 3.3.0.GA iOS 7.1

STEPS TO TEST

- Import Kitchen Sink project - Run the project on iOS simulator 7.1 - Go to mashups -->Facebook --> Query --> Run Query - Facebook Query window doesn't escape

WORKAROUND

Facebook Query window is a modal window. If we use Navigation Window for iOS then it works as expected. Updated runQuery function

	function runQuery() {
		b1.title = 'Loading...';
	
		var tableView = Ti.UI.createTableView({minRowHeight:100});
		var win = Ti.UI.createWindow({title:'Facebook Query'});
		win.add(tableView);
	var win1 = Titanium.UI.iOS.createNavigationWindow({
   window: win
});
		// create close button on window nav
		var close = Titanium.UI.createButton({
			title:'Close'
		});
		close.addEventListener('click', function() {
			win1.close();
		});
		if (Ti.Platform.osname == 'iphone' || Ti.Platform.osname == 'ipad') {
			win.setRightNavButton(close);
		}
	
		// run query, populate table view and open window
		var query = "SELECT uid, name, pic_square, status FROM user ";
		query +=  "where uid IN (SELECT uid2 FROM friend WHERE uid1 = " + facebook.uid + ")";
		query += "order by last_name limit 20";
		Ti.API.info('user id ' + facebook.uid);
		facebook.request('fql.query', {query: query},  function(r) {
			if (!r.success) {
				if (r.error) {
					alert(r.error);
				} else {
					alert("call was unsuccessful");
				}
				return;
			}
			var result = JSON.parse(r.result);
			var data = [];
			for (var c=0;c<result.length;c++)
			{
				var row = result[c];
	
				var tvRow = Ti.UI.createTableViewRow({
					height:'auto',
					selectedBackgroundColor:'#fff',
					backgroundColor:'#fff'
				});
				var imageView;
				imageView = Ti.UI.createImageView({
					image:row.pic_square === null ? '/images/custom_tableview/user.png' : row.pic_square,
					left:10,
					width:50,
					height:50
				});
	
				tvRow.add(imageView);
	
				var userLabel = Ti.UI.createLabel({
					font:{fontSize:16, fontWeight:'bold'},
					left:70,
					top:5,
					right:5,
					height:20,
					color:'#576996',
					text:row.name
				});
				tvRow.add(userLabel);
	
				var statusLabel = Ti.UI.createLabel({
					font:{fontSize:13},
					left:70,
					top:25,
					right:20,
					height:'auto',
					color:'#222',
					text:(!row.status || !row.status.message ? 'No status message' : row.status.message)
				});
				tvRow.add(statusLabel);
	
				tvRow.uid = row.uid;
	
				data[c] = tvRow;
			}
			
			tableView.setData(data, { animationStyle : Titanium.UI.iPhone.RowAnimationStyle.DOWN });
			
			win1.open({modal:true});
			b1.title = 'Run Query';
		});
	}
	

EXPECTED RESULT

It’s not working as expected.

Comments

  1. Mauro Parra-Miranda 2014-07-21

    Thanks for your report! The Platform team will set the priority on this.
  2. Lee Morris 2017-05-02

    Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.

JSON Source