GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-08-09T02:54:40.000+0000 |
Affected Version/s | Release 2.0.1 |
Fix Version/s | Sprint 2012-14 Core, Sprint 2012-14 MW, Sprint 2012-16 API, Release 3.0.0, Release 2.0.3 |
Components | TiAPI |
Labels | api, module_api, parity, qe-testadded, regression |
Reporter | Davide Cassenti |
Assignee | Blain Hamon |
Created | 2012-07-05T04:08:35.000+0000 |
Updated | 2012-08-10T11:27:50.000+0000 |
Problem description
When using Ti.Facebook to login, once the user has entered their credentials and clicks login, the screen shows a 'Page not found' error and the login fails. However, trying to login again the second time, works. It also works if the app on Facebook is set as Native/Desktop and not Web.
Steps to reproduce
1. Create a Facebook app (be sure it is set to Web, as it is by default)
2. Create an app with the code below (set the app id accordingly to the Facebook app)
3. Click the 'Login with Facebook' button
4. Enter a valid Facbeook account credentials and click Login
Ti.Facebook.appid = '[APP ID]';
Ti.Facebook.permissions = ['publish_stream'];
Ti.Facebook.addEventListener('login', function(e) {
if (e.success) {
alert('Logged in');
}
});
Ti.Facebook.addEventListener('logout', function(e) {
alert('Logged out');
});
var win2 = Ti.UI.createWindow();
// Add the button. Note that it doesn't need a click event listener.
win2.add(Ti.Facebook.createLoginButton({
top : 50,
style : Ti.Facebook.BUTTON_STYLE_WIDE
}));
win2.open();
Expected result
Facebook authentication happens and we are able to log into Facebook.
Current result
A 'Page not found' screen is shown as soon as the login is performed.
Related links
Looks like the problem is also present on native apps, and it does not occour if the app is set as Native/Desktop.
See this topic for some details:
http://developers.facebook.com/blog/post/2012/03/02/enhanced-auth-dialog-and-updates-to-permissions/
A quick test in Mobile Web shows that it's having some issues too, although not as severe. Everything logs in OK, but the log in window doesn't disappear and we don't get the callback saying we are logged in. The user is logged in though, and if the page is reloaded, then everything works just fine. I'm not sure if it's caused by the same underlying issue causing problems on iOS and Android, but the timing is suspicious.
This issue came from community (titans) and forwarded to us by Jeff H. Can platform look into this ASAP?
What was the resolution here? My assumption was that this was a FB error, since others (not Titanium people) were having problems with both the API and web versions? Just curious.
Reopening issue. After pressing "Login with Facebook" button, an error message "An error occurred. Please try again later" appears. After clicking "OK" button and putting the credentials it will be possible to login to the Facebook. Tested with: Titanium Studio, build: 2.1.1.201207121732 Titanium SDK: 2.1.1.v20120712160111 Devices: iPhone Simulator 5.1; iPad 2 (5.1.1); iPod 5.1
Closing as fixed. Tested with: Titanium Studio, build: 2.1.1.201207161421 Titanium SDK: 2.1.1.v20120712160111 Device: iPad 3rd gen (5.1.1)
For QE - use this code with specified app. ID:
For Mobile Web: you will need to use a different App ID than the one mentioned by @Tamila that is custom tailored to your testing environment. See http://docs.appcelerator.com/titanium/2.1/index.html#!/guide/Mobile_Web_Debugging_and_Testing_Tools-section-31525350_MobileWebDebuggingandTestingTools-Facebook for more information about using Facebook on MW.
Reopening to edit labels
For SDK 2.0.3,Application (for the code posted by Tamila in the comments) crashes on Android but not on iOS.Please find the errorlogs attached in the bug. Tested with Titanium SDK: 2.0.3.v20120806151610 Tested with Titanium Studio: 2.1.1.201207271312 Platform & version: iOS (5.1) Device Details: iPhone 4S, Android Emulator (2.2), Android Galaxy Note (2.3.6) Host Operating System: OSX 10.8
The NPE error reported in the last comment is because there is no constant "Ti.Facebook.BUTTON_STYLE_WIDE" in Android in 2_0_X branch. Those constants were added in 2_1_X (TIMOB-6234) and will not be back ported to 2_0_X. Therefore, for the test in 2_0_X branch we should use the test case below:
closing and verified( as per the code posted by Ping Wang in the comment) Tested with Titanium SDK: 2.0.3.v20120806151610 Tested with Titanium Studio: 2.1.1.201207271312 Platform & version: iOS (5.1) Device Details: iPhone 4S, Android Emulator (2.2), Android Google Nexus (4.0.2), Android Galaxy Note (2.3.6) Host Operating System: OSX 10.8
Note that the property BUTTON_STYLE_WIDE was defined on Android in 2.1.0 (TIMOB-6234). Earlier, it existed only on iOS. This is outside the scope of the Facebook SDK update. So any applications that upgrade from 2.0.X to 2.0.3 will work fine without any changes. The test case in the bug was written with the 2.1.0 SDK in mind so it does not work for 2.0.X. As far as the end developers are concerned this is a non issue.
Reopening to update labels.