{ "id": "64716", "key": "TIMOB-3671", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" }, { "id": "11330", "description": "Planning Week", "name": "Sprint 2011-21", "archived": true, "released": true, "releaseDate": "2011-05-30" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-05-26T10:42:12.000+0000", "created": "2011-04-25T13:32:43.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11243", "name": "Release 1.6.0 M10", "archived": true, "released": true, "releaseDate": "2011-02-21" } ], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-05-26T10:42:12.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "If a window is opened using the url property and an alert or dialog window is called inside that window in a 'Titanium.Facebook.addEventListener' function the alert or dialog will open behind all windows.\n\nStep 1: Run the code below\nStep 2: click the login button\nStep 3: the 'postToFeed()' dialog will appear behind the open windows.\nStep 4: hit the back button a couple times to see it\nStep 5: click the logout button.\nStep 6: an alert will fire but you will not see it.\nStep 7: hit the back button a few times to see the alert.\n\nIf you include the code from fb.js into app.js and not use the url property to open the window, the alert and dialog will open properly as expected even if you use a heavyweight window.\n\nIf you hit the 'Post' button after you are logged in, the dialog will pop up as expected. It is not called from a facebook event listener function.\n\napp.js\n{code:javascript}\nvar win = Ti.UI.createWindow({fullscreen:true});\n\nvar button = Ti.UI.createButton({ width:200, height:90, title:\"CONNECT\"});\nwin.add(button);\n\nbutton.addEventListener('click', function(){\n\tvar win2 = Ti.UI.createWindow({\n\t\turl:'fb.js',\n\t\tfullscreen:false\n\t});\n\twin2.open();\n});\n\nwin.open();\n{code}\nfb.js\n{code:javascript}\nvar win = Ti.UI.currentWindow;\n\nTitanium.Facebook.appid = '187692147928682';\nTitanium.Facebook.permissions = ['publish_stream'];\nTitanium.Facebook.addEventListener('logout', function(e) {\n alert('Logged out');\n\tbutton.title = \"Login\";\n});\nTi.Facebook.addEventListener('login', function(e) {\n\tTi.API.info(\"Logged in now!\");\n if ( ! e.cancelled && ! e.error) {\n\t\tbutton.title = \"Logout\";\n\t\tpostToFeed();\n // postButton.fireEvent('click');\n }\n\telse {\n\t\tTi.API.info(\"Error logging in\");\n\t}\n}); \n\nvar button = Ti.UI.createButton({ \n\ttop:100,\n\theight: 60,\n\twidth: 200\n});\nif(Ti.Facebook.loggedIn) {\n\tbutton.title = \"Logout\";\n}\nelse {\n\tbutton.title = \"Login\";\n}\nwin.add(button); \n\nbutton.addEventListener('click', function(e){\n\tif(Ti.Facebook.loggedIn) {\n\t\tTi.Facebook.logout();\n\t\tbutton.title = \"Login\";\n\t\tTi.API.info(\"already logged in..\");\n\t}\n\telse {\n\t\tTi.API.info(\"Not logged in.. Logging in\");\n\t\tTi.Facebook.authorize();\n\t\tbutton.title = \"Logout\";\n\t}\n});\n\nvar postToFeed = function(e){\n\tvar data = {\n\t\tlink: \"https://developer.mozilla.org/en/JavaScript\",\n\t\tname: \"Best online Javascript reference\",\n\t\tmessage: \"Use Mozilla's online Javascript reference\",\n\t\tcaption: \"MDN Javascript Reference\",\n\t\tpicture: \"https://developer.mozilla.org/media/img/mdn-logo.png\",\n\t\tdescription: \"This section is dedicated to JavaScript...\"\n\t};\n\tTitanium.Facebook.dialog('feed', data, function(e) {\n\t// Titanium.Facebook.requestWithGraphPath('feed', data, 'POST', function(e) {\n\t\tTi.API.info('Callback ran!');\n if (e.success&&e.result) {\n alert('Posted to your Facebook wall');\n } else {\n if (e.error) {\n Ti.UI.createAlertDialog({\n title:'Facebook Error',\n message:e.error\n }).show();\n } else if (e.cancelled) {\n Ti.API.info('Facebook was cancelled');\n } else {\n Ti.API.info('Facebook threw up an unkown result');\n }\n }\n });\n};\n\nvar postButton = Ti.UI.createButton({\n\ttitle: 'Post',\n\theight: 60,\n\twidth: 200,\n\ttop: 200\n});\npostButton.addEventListener('click', function(e){\n\tpostToFeed();\n});\n\nwin.add(postButton);\n{code}\n\nh3. Associated Helpdesk Ticket\nhttp://appc.me/c/IAQ-38639-246", "attachment": [], "flagged": false, "summary": "Android: Facebook module popup windows display in background if called from a fb event listener in a window created with the url property", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 1.6.2, Android Emulator 2.2", "comment": { "comments": [ { "id": "134310", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmed working as of 1.7.0 (05/15/11 17:26 e6afca8)\nwith Android 2.2", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-26T09:18:40.000+0000", "updated": "2011-05-26T09:18:40.000+0000" }, { "id": "134317", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Also verified fixed with Nexus S, 2.3.4, Titanium Studio, build: 1.0.0.201105260623, Titanium SDK version: 1.7.X r5e4f9c7e. Closing.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-05-26T10:42:12.000+0000", "updated": "2011-05-26T10:42:12.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }