{ "id": "110056", "key": "TIMOB-12830", "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": [], "resolution": null, "resolutiondate": null, "created": "2013-02-22T22:47:13.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:43.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "REPRODUCTION:\r\nRun the code below with 3.1.0 and the Facebook v3 module on the iOS simulator. After logging in, click the button to try and post an event.\r\n\r\nRESULTS:\r\nOn the iOS platform, the API call fails. The console outputs:\r\n\r\n{noformat}\r\n[ERROR] : \b\b \b: HTTP status code: 400\r\n{noformat}\r\n\r\nand an alert dialog displays:\r\n{noformat}\r\nThe operation couldn't be completed. (com.facebook.sdk error 5.)\r\n{noformat}\r\n\r\nOn the Android platform, the GRAPH API call succeeds.\r\n\r\nADDITIONAL NOTES:\r\nWith 3.0.2.GA, the code runs OK on both Android and iOS.\r\n\r\nThe other examples mentioned in http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Facebook\r\nwork except the logout example for iOS (TIMOB-12828).\r\n\r\nTEST CODE: \r\n{code}\r\n//var fb = Ti.Facebook;\r\nvar fb = require('facebook');\r\nfb.appid = 495338853813822;\r\nfb.permissions = ['create_event'];\r\nfb.addEventListener('login', function(e) {\r\n if (e.success) {\r\n alert('Logged In');\r\n } else if (e.error) {\r\n alert(e.error);\r\n } else if (e.cancelled) {\r\n alert(\"Canceled\");\r\n }\r\n});\r\n\r\nvar evt = Ti.UI.createButton({title: 'GRAPH Create Event'});\r\nevt.addEventListener('click', function(e){\r\n\tvar starttime = new Date(2013, 4, 30, 17, 0);\r\n\tvar endtime = new Date(2013, 4, 30, 19, 0);\r\n\tvar title = \"Barry's Birthday Celebration\";\r\n\tvar description = \"Barry will have a great party\";\r\n\tvar data = {\r\n\t start_time: JSON.stringify(starttime), // API expects a JSON stringified date\r\n\t end_time: JSON.stringify(endtime),\r\n\t summary: description,\r\n\t name: title\r\n\t};\r\n\tfb.requestWithGraphPath('me/events', data, 'POST', function(e) {\r\n\t if (e.success) {\r\n\t alert(\"Success! Returned from FB: \" + e.result);\r\n\t } else {\r\n\t if (e.error) {\r\n\t alert(e.error);\r\n\t } else {\r\n\t alert(\"Unknown result\");\r\n\t }\r\n\t }\r\n\t});\r\n});\r\n\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\nwin.add(evt);\r\nwin.open();\r\n\r\nif (!fb.loggedIn) {\r\n\tfb.authorize();\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS Facebook v3 Module: Cannot create an event using the GRAPH API", "creator": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Mac OSX 10.7.5\r\nTiStudio 3.0.2\r\nTiSDK 3.0.2.GA for Ti.Facebook\r\nTiSDK 3.1.0 (02/21/13 13:52 a850c18) for Facebook v3 modules\r\nxCode 4.5.1 / iOS 6 Simulator\r\nfacebook-iphone-3.1.0.zip\r\nAndroid 4.2\r\nfacebook-android-3.0.0.zip", "comment": { "comments": [ { "id": "239474", "author": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Found some new information. Investigating.", "updateAuthor": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-22T23:13:14.000+0000", "updated": "2013-02-22T23:13:14.000+0000" }, { "id": "239477", "author": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Also tried using the reauthorize method. Did not work for creating an event, but did work for posting a status update.\r\n\r\n{code}\r\n// Initialization\r\n...\r\nfb.permissions = ['read_stream'];\r\nfb.forceDialogAuth = false;\r\n...\r\n// After setting up the data dict object...\r\n\r\n fb.reauthorize(['create_event'], 'everyone', function(e){\r\n if (e.success) {\r\n fb.requestWithGraphPath('me/events', data, 'POST', function(e) { \r\n... \r\n\r\n{code}", "updateAuthor": { "name": "bhatfield", "key": "bhatfield", "displayName": "Benjamin Hatfield", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-22T23:42:48.000+0000", "updated": "2013-02-22T23:43:22.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }