我们的两个应用程序都存在这个问题——一个是用 Sencha Touch2 编写的,另一个是没有这种 sh0t 的。在这两个应用程序上,我们使用 forge.facebook 遇到相同的错误:首先进行身份验证,然后成功重新打开应用程序并从 facebook 注销 - 这导致应用程序崩溃并弹出:“不幸的是,AppName 已停止。”
这是logcat登录登录然后注销而不重新打开应用程序:
D/Forge (10379): Returned: {"content":true,"callid":"1B5B7367-8CE2-4F45-AE6A-CBE660026F79","status":"success"}
D/Forge (10379): Native call facebook.logout with task.params: {}
D/Facebook-Util(10379): GET URL: https://api.facebook.com/restserver.php?access_token=CAAGM3jqOnesBAIc4G2SHQxgXiIpgWbWIMZAHpw5V2G5BW8nUwjPhosSCBp7EN1Ktw0i4JkVVIrs4Alza3cTzEG1ukFHLuC3MSRBYXViywvoBGlYF2CJh26ecL4ZCwfmEbdMTWwqrvK2lAJ7rLRm4TipkEknTcZD&method=auth.expireSession&format=json
W/InputMethodManagerService( 2176): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@418be858 attribute=null, token = android.os.BinderProxy@4134a3a8
D/dalvikvm(10379): GC_CONCURRENT freed 529K, 46% free 4145K/7588K, paused 5ms+3ms, total 55ms
D/Forge (10379): Returned: {"content":null,"callid":"CF3C2DED-3CB5-4611-8348-BC355B24D4FB","status":"success"}
andlog 登录然后注销并重新打开应用程序:
D/Forge (10634): Returned: {"content":true,"callid":"4A65AEED-B87B-48A3-8DB2-1438E9D4A321","status":"success"}
D/Forge (10634): Native call facebook.logout with task.params: {}
D/Facebook-Util(10634): GET URL: https://api.facebook.com/restserver.php?access_token=CAAGM3jqOnesBABZB5d11jcrodjJxHbQfsVaO2eeRscElZCEW2NBjSN176YQqxfTKUZAtAd1FxlikpMEw0SrKorJ89TtQWj0zuXBH1m15ydvQo42sFOEormrKobfzXXTmHuR1Ip4dV8zjlWSZCPRP&method=auth.expireSession&format=json
W/InputMethodManagerService( 2176): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@412dbd50 attribute=null, token = android.os.BinderProxy@41491850
W/dalvikvm(10634): threadid=32: thread exiting with uncaught exception (group=0x40dd7930)
E/AndroidRuntime(10634): FATAL EXCEPTION: Thread-487
E/AndroidRuntime(10634): java.lang.IllegalArgumentException: Invalid context argument
E/AndroidRuntime(10634): at android.webkit.CookieSyncManager.createInstance(CookieSyncManager.java:86)
E/AndroidRuntime(10634): at com.facebook.internal.Utility.clearCookiesForDomain(Utility.java:261)
E/AndroidRuntime(10634): at com.facebook.internal.Utility.clearFacebookCookies(Utility.java:285)
E/AndroidRuntime(10634): at com.facebook.Session.closeAndClearTokenInformation(Session.java:593)
E/AndroidRuntime(10634): at com.facebook.android.Facebook.logoutImpl(Facebook.java:667)
E/AndroidRuntime(10634): at com.facebook.android.AsyncFacebookRunner$1.run(AsyncFacebookRunner.java:89)
W/ActivityManager( 2176): Force finishing activity com.bigmage.facerage/io.trigger.forge.android.core.ForgeActivity
D/AKMD2 ( 2176): akm_disable_sensor: Accel is disabled. (orien = 0)
I/AKMD2 ( 2176): enable_accelerometer, mEnabled = 1, enable = 0
D/dalvikvm(10634): GC_CONCURRENT freed 3635K, 52% free 3671K/7588K, paused 13ms+4ms, total 189ms
D/dalvikvm( 2176): GC_FOR_ALLOC freed 649K, 34% free 11995K/18024K, paused 114ms, total 116ms
I/dalvikvm-heap( 2176): Grow heap (frag case) to 12.996MB for 635812-byte allocation
I/ActivityManager( 2176): Displayed com.cyanogenmod.trebuchet/.Launcher: +666ms
D/android.widget.GridLayout( 2479): vertical constraints: y2-y0>=120, y3-y2>=78, y3-y0<=192, y2-y1<=1 are inconsistent; permanently removing: y3-y0<=192.
D/Forge (10634): Native call request.ajax with task.params: {"url":"http://192.168.1.109/facerage.dev/backend/data/getStatus?token=CAAGM3jqOnesBABZB5d11jcrodjJxHbQfsVaO2eeRscElZCEW2NBjSN176YQqxfTKUZAtAd1FxlikpMEw0SrKorJ89TtQWj0zuXBH1m15ydvQo42sFOEormrKobfzXXTmHuR1Ip4dV8zjlWSZCPRP&userId=100005089685883&langId=1&callback=Ext.data.JsonP.callback5&_dc=1374837560572&","username":null,"password":null,"data":null,"headers":{"Accept":"*/*"},"timeout":60000,"type":"GET","boundary":null,"files":null,"fileUploadMethod":"multipart"}
D/Forge (10634): Returned: {"content":"try{Ext.data.JsonP.callback5({\"status\":\"ok\",\"data\":{\"user\":{\"id\":100005089685883,\"isUser\":1,\"mutual\":0,\"name\":\"\\u0418\\u0432\\u0430\\u043d \\u0421\\u0442\\u0443\\u0434\\u0438\\u043e \\u0411\\u0438\\u0433\\u043c\\u0435\\u0439\\u0434\\u0436 \\u0412\\u0430\\u0440\\u043d\\u0430\",\"score\":0,\"coins\":\"3975\",\"version\":2,\"type\":\"free\"},\"games\":{\"waiting\":1,\"total\":1,\"checksum\":\"0b0e694b092ad4361bb76d74eb33cdc4\"},\"gamePriceFree\":500,\"gamePricePaid\":500,\"lastUpdate\":0,\"forceUpdate\":0,\"scoreHasUpdate\":0,\"itemsPerPage\":25},\"message\":\"\"});} catch(err) {}","callid":"BE6E4316-40C7-4484-A63B-9DBECDC1EA54","status":"success"}
I/Forge (10634): Pausing webview while application not focussed.
D/Forge (10634): Returned: {"event":"event.appPaused","params":null}
D/webviewglue(10634): nativeDestroy view: 0x4c16ad10
我试图在没有任何东西的情况下初始化应用程序,但错误仍然存在。如果我在重新打开应用程序后随时触发 forge.facebook.logout() - 就会崩溃。把我能想到的一切都做到了。甚至用过
https://api.facebook.com/restserver.php?access_token=239450298&method=auth.expireSession&format=json
这是成功的,但 forge.facebook.authorize 或 hasAuth.. 仍然返回我无效的令牌,我唯一能做的就是 forge.facebook.logout() :)
来自支持(我们为此支付了额外费用)礼貌地告诉我们停止工作,因为他们在 facebook 上的演示应用程序工作正常,但他们无法重现问题......但是。如果有人遇到同样的问题,请...您还需要什么吗?我正在使用的代码如他们的网站上所示 - 仅此而已。
哦,当我尝试使用此代码使用标签登录时:
forge.tabs.openWithOptions({
url: 'https://m.facebook.com/dialog/oauth?display=touch&client_id=1234970&scope=email%2Cfriends_about_me%2Cfriends_birthday%2Cfriends_hometown%2Cfriends_relationships%2Cfriends_work_history&type=user_agent&redirect_uri=fbconnect%3A%2F%2Fsuccess',
pattern: 'fbconnect://success',
title: 'Login Page'
}, function (data) {
});
我的应用程序崩溃并弹出:“不幸的是,AnotherInstalledApp 已停止。”
I/Forge (17044): Allowing another Android app to handle URL: fbconnect://success#access_token=CAAGM3jqOnesBACnD1tDaA85XvivpYxve9mLU5JTTKyGWX7TnoRCvdFQsYFup3uP8GJREnwQ5hJWsnwGRuLJIC1xyrata2SlrZAHK23nQFfhX8nD4Jw6GWzTd2MLTwJr3LD3EBMSjEWpCqyneumO3YgzVzoisZD&expires_in=5103179
I/ActivityManager( 2176): START u0 {act=android.intent.action.VIEW dat=fbconnect://success cmp=com.com2us.towerdefense.normal.freefull.google.global.android.common/com.com2us.hub.activity.ActivitySearchFriendsFacebook} from pid 17044
I/ActivityManager( 2176): Start proc com.com2us.towerdefense.normal.freefull.google.global.android.common for activity com.com2us.towerdefense.normal.freefull.google.global.android.common/com.com2us.hub.activity.ActivitySearchFriendsFacebook: pid=17261 uid=10084 gids={50084, 3003, 1015, 1028}
怎么回事?!