[AC-1677] Facebook's Module don't work anymore for Android!
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2014-07-21T21:38:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Appcelerator Modules |
Labels | android, facebook |
Reporter | Douglas Hennrich |
Assignee | Mauro Parra-Miranda |
Created | 2014-07-14T21:31:16.000+0000 |
Updated | 2016-03-08T07:38:10.000+0000 |
Description
this is the error that I get when I tried to log in on Android
[ERROR] : FacebookModule: (main) [38143,71824] LoginDialogListener onFacebookError: The connection to the server was unsuccessful.
[ERROR] : FacebookModule: com.facebook.android.FacebookError: The connection to the server was unsuccessful.
[ERROR] : FacebookModule: at com.facebook.android.Facebook.onSessionCallback(Facebook.java:433)
[ERROR] : FacebookModule: at com.facebook.android.Facebook.access$000(Facebook.java:97)
[ERROR] : FacebookModule: at com.facebook.android.Facebook$2.call(Facebook.java:379)
[ERROR] : FacebookModule: at com.facebook.Session$3$1.run(Session.java:1239)
[ERROR] : FacebookModule: at android.os.Handler.handleCallback(Handler.java:587)
[ERROR] : FacebookModule: at android.os.Handler.dispatchMessage(Handler.java:92)
[ERROR] : FacebookModule: at android.os.Looper.loop(Looper.java:123)
[ERROR] : FacebookModule: at android.app.ActivityThread.main(ActivityThread.java:3687)
[ERROR] : FacebookModule: at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR] : FacebookModule: at java.lang.reflect.Method.invoke(Method.java:507)
[ERROR] : FacebookModule: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
[ERROR] : FacebookModule: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
[ERROR] : FacebookModule: at dalvik.system.NativeStart.main(Native Method)
[ERROR] : FacebookModule: (main) [4,71828] onAuthFail: The connection to the server was unsuccessful.
and this is the code that I use to try to log in
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var fb = require('facebook');
fb.appid = 755377651155999;
fb.permissions = ['user_events', 'user_friends', 'friends_events', 'rsvp_event' ];
fb.addEventListener('login', function(e) {
if (e.success) {
alert('Logged in');
}
});
fb.addEventListener('logout', function(e) {
alert('Logged out');
});
// Add the button. Note that it doesn't need a click event listener.
win.add(fb.createLoginButton({
top : 50,
style : fb.BUTTON_STYLE_WIDE
}));
win.open();
Hello, We tested this issue with our sample code. its working well as we expected. It's not a SDK bug.
Testing Environment:
Titanium SDK: 3.2.3.GA and 3.3.0.RC Titanium CLI: 3.2.3 OS X Version: 10.9.3 Android API Level: 17 and 19Test Code:
var win = Ti.UI.createWindow({ backgroundColor : 'white' }); var fb = require('facebook'); fb.appid = 755377651155999; fb.permissions = ['user_events', 'user_friends', 'friends_events', 'rsvp_event']; fb.addEventListener('login', function(e) { if (e.success) { alert('Logged in'); } }); fb.addEventListener('logout', function(e) { alert('Logged out'); }); // Add the button. Note that it doesn't need a click event listener. win.add(fb.createLoginButton({ top : 50, style : fb.BUTTON_STYLE_WIDE })); win.open();STEPS TO REPRODUCE
- Create a simple project. - Update this code in app.js - Add Facebook module in tiapp.xml - Run this with testing environmentTESTING RESULT
Its working perfectly. There is no any kinds of error. ThanksI'm also experiencing the same problem. Compiling my Android apps with 3.30GA SDK on an Android 4.4.2 HTC One they get stuck on the splash screen. I'm getting this stack trace as my app gets stuck apparently loading modules. 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): Trying to getInterface() threw security exception 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): java.lang.SecurityException: You do not have permssion to access this service: uid 10053 does not have com.facebook.system.permission.FACEBOOK_SYSTEM_DASH_SERVICE. 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at android.os.Parcel.readException(Parcel.java:1474) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at android.os.Parcel.readException(Parcel.java:1428) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.ansible.oem.method.FacebookMethod$Client.a(FacebookMethod.java:88) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.ansible.oem.FacebookServiceClient.a(FacebookServiceClient.java:31) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.dash.common.service.FacebookServiceHelper.a(FacebookServiceHelper.java:194) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.dash.common.service.FacebookServiceHelper.A_(FacebookServiceHelper.java:50) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.common.init.InitializerProfilingUtil.a(InitializerProfilingUtil.java:55) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.common.init.impl.FbAppInitializer.a(FbAppInitializer.java:294) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.common.init.impl.FbAppInitializer.a(FbAppInitializer.java:260) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.common.init.impl.FbAppInitializer.d(FbAppInitializer.java:243) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.common.init.impl.FbAppInitializer.a(FbAppInitializer.java:80) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.common.init.impl.FbAppInitializer$2.run(FbAppInitializer.java:202) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at java.util.concurrent.FutureTask.run(FutureTask.java:237) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at java.util.concurrent.FutureTask.run(FutureTask.java:237) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.common.executors.ConstrainedExecutorService$Worker.run(ConstrainedExecutorService.java:279) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at com.facebook.common.executors.NamedThreadFactory$1.run(NamedThreadFactory.java:35) 07-19 20:44:35.300: W/fb4a(:dash):FacebookServiceHelper(16686): at java.lang.Thread.run(Thread.java:864)