facebook problems

for some reason my post to facebook is now working anymore i have remove my app form my “facebook Apps you use” page end when i open the app i get “app would like to access your…”  popup and when i click on OK the app is not readded to the list. is anyone els havin the same problems? 

code: 

local facebook = require "facebook" local fbAppID = " \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* "      \_W = -29;     storyboard.purgeScene("restart")     keeping\_score = false     function onLoginSuccess() -- Upload 'corona.png' to current user's account      attachment = {        message = "I have achieved ".. score .. " points playing.... download for FREE iPhone & Android at www.site",         source = { baseDir=system.ResourceDirectory, filename="Built\_with\_Corona\_LG.png", type="image" }     }     facebook.request( "me/photos", "POST", attachment )     facebook.request( "me/feed", "POST", {message = "I have achieved (".. score .. ") points, playing... download for FREE iPhone & Android at www.site"} ) end -- facebook listener function fbListener( event )     if event.isError then         native.showAlert( "ERROR", event.response, { "OK" } )     else         if event.type == "session" and event.phase == "login" then             -- login was a success; call function             onLoginSuccess()                  elseif event.type == "request" then             -- this block is executed upon successful facebook.request() call local function onComplete( event )     if "clicked" == event.action then         local i = event.index                      if 1 == i then         storyboard.gotoScene("adgameover", "fade", 400)         end     end end        native.showAlert( "Success", "Your Score has been uploaded.", { "OK" }, onComplete )         end     end end facebook.login( fbAppID, fbListener, { "publish\_stream" } )  

    

What version of Corona SDK are you trying to build with?

Thanks

Rob

CoronaSDK-2013.2076.dmg

Hi rob any news on this?

If the user disables your app in the settings, then they have to turn it on.  We really can’t detect it because it generates a generic error (type 2 I think).  Your best bet is if get this error to is to show a native.showAlert() asking them to check the status of your app in their device’s settings.

Rob

Hi Rob,

I’m still having a problem with the facebook connection, i have tried it on multipole android phones but its not connecting

local facebook = require( "facebook" ) -- listener for "fbconnect" events local function listener( event )     if ( "session" == event.type ) then         -- upon successful login, request list of friends         if ( "login" == event.phase ) then             facebook.request( "me/friends" )             facebook.request( "me/feed", "POST", { message="Hello Facebook" } )         end     elseif ( "request" == event.type ) then         -- event.response is a JSON object from the FB server         local response = event.response         print( response )     end end -- first argument is the app id that you get from Facebook facebook.login( "\*\*\*\*\*\*\*", listener, {"publish\_stream"} )  --replace XXXXXXXXXX with your Facebook App ID  

even this this code is not working which is  strange as it was working before and i didn’t change anything  in the code.

its not showing up in the list (even when i klick OK to connect in the app):

One0BRj.png

i can mail you the apk if that helps ? 

Kevin

You likely don’t have something setup correctly.  Can you do screen shots of your settings from developers.facebook.com and the corona screen where you are building the app?

Is it trying to login to facebook?  What’s going on in your console log?  Have you put prints in your call back listener to make sure you are not getting errors from facebook?

Rob

lDp029F.png

2y4WCYs.png

not sure on how to do this :  Have you put prints in your call back listener to make sure you are not getting errors from facebook?

Kevin

Well there is one obvious problem.  Facebook apps do not run in the simulator.  They only run on device.

Rob

yes i know as mentioned before:  i have tried it on multipole android phones but its not connecting

kevin

We need to see the log file (adb logcat) from the device.  The log file from the simulator doesn’t help. 

Rob

Hi Rob here is the adb logcat hope it helps : http://we.tl/EfgBOkLlmW

I don’t see any evidence in the log file that facebook is being called at all.  Can you show some more code on where you’re invoking facebook?  Can you put some print statements in your facebook handler to see if you’re getting in there and what data is being returned from the call?

Thanks

Rob

here is a little test i have done:

local facebook = require( "facebook" ) -- listener for "fbconnect" events local function listener( event )     if ( "session" == event.type ) then         -- upon successful login, request list of friends         if ( "login" == event.phase ) then             facebook.request( "me/friends" )             facebook.request( "me/feed", "POST", { message="Hello Facebook" } )         end     elseif ( "request" == event.type ) then         -- event.response is a JSON object from the FB server         local response = event.response         print( response )     end end -- first argument is the app id that you get from Facebook facebook.login( "\*\*\*\*\*\*\*\*\*\*", listener, {"publish\_stream"} )   

V/AudioPolicyManagerBase( &nbsp;208): setOutputDevice() setting same device 0000 or null device for output 2 W/fb4a(:\<default\>):BlueServiceQueue( 2691): Exception during service W/fb4a(:\<default\>):BlueServiceQueue( 2691): com.facebook.http.protocol.ApiException: Key hash JGn9F2vDQ\_w6hexLxdefCUpxYIA does not match any stored key hashes. W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.protocol.ApiResponseChecker.b(ApiResponseChecker.java:83) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.protocol.ApiResponseChecker.a(ApiResponseChecker.java:162) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.protocol.ApiResponse.g(ApiResponse.java:239) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:272) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:29) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.protocol.ApiResponseHandler.a(ApiResponseHandler.java:56) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.protocol.ApiResponseHandler.handleResponse(ApiResponseHandler.java:29) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.common.FbHttpRequestProcessor.a(FbHttpRequestProcessor.java:280) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.common.FbHttpRequestProcessor.a(FbHttpRequestProcessor.java:141) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.common.FbHttpRequestProcessor.b(FbHttpRequestProcessor.java:103) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.common.FbHttpRequestProcessor.a(FbHttpRequestProcessor.java:196) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.protocol.SingleMethodRunnerImpl.a(SingleMethodRunnerImpl.java:374) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.protocol.SingleMethodRunnerImpl.a(SingleMethodRunnerImpl.java:151) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.http.protocol.AbstractSingleMethodRunner.a(AbstractSingleMethodRunner.java:18) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.katana.server.handler.PlatformOperationHandler.c(PlatformOperationHandler.java:367) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.katana.server.handler.PlatformOperationHandler.a(PlatformOperationHandler.java:260) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.fbservice.service.BlueServiceQueue.e(BlueServiceQueue.java:299) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:53) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.fbservice.service.BlueServiceQueue$3.run(BlueServiceQueue.java:230) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at java.util.concurrent.FutureTask.run(FutureTask.java:234) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.common.executors.ListenableScheduledFutureImpl.run(ListenableScheduledFutureImpl.java:59) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at android.os.Handler.handleCallback(Handler.java:730) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at android.os.Handler.dispatchMessage(Handler.java:92) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at android.os.Looper.loop(Looper.java:137) W/fb4a(:\<default\>):BlueServiceQueue( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at android.os.HandlerThread.run(HandlerThread.java:61) W/fb4a(:\<default\>):GDPDialog( 2691): Failed to send W/fb4a(:\<default\>):GDPDialog( 2691): com.facebook.fbservice.service.ServiceException: API\_ERROR: API\_ERROR W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.fbservice.ops.BlueServiceOperation.c(BlueServiceOperation.java:640) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.fbservice.ops.BlueServiceOperation.c(BlueServiceOperation.java:48) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.facebook.fbservice.ops.BlueServiceOperation$2.run(BlueServiceOperation.java:605) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at android.os.Handler.handleCallback(Handler.java:730) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at android.os.Handler.dispatchMessage(Handler.java:92) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at android.os.Looper.loop(Looper.java:137) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at android.app.ActivityThread.main(ActivityThread.java:5419) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at java.lang.reflect.Method.invokeNative(Native Method) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at java.lang.reflect.Method.invoke(Method.java:525) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) W/fb4a(:\<default\>):GDPDialog( 2691): &nbsp;&nbsp;&nbsp;&nbsp;at dalvik.system.NativeStart.main(Native Method) D/dalvikvm( &nbsp;677): GC\_FOR\_ALLOC freed 5334K, 20% free 75606K/93836K, paused 166ms, total 166ms V/SmartFaceService - 3rd party pause( &nbsp;677): onReceive [android.intent.action.ACTIVITY\_STATE/com.facebook.katana/pause] D/PointerIcon( &nbsp;677): setHoveringSpenIconStyle1 pointerType: 10001iconType:1 flag:0 D/PointerIcon( &nbsp;677): setHoveringSpenCustomIcon IconType is same.1 D/STATUSBAR-StatusBarManagerService( &nbsp;677): manageDisableList what=0x0 pkg=WindowManager.LayoutParams I/power &nbsp; ( &nbsp;677): \*\*\* acquire\_dvfs\_lock : lockType : 1 &nbsp;freq : 1350000&nbsp; D/SSRMv2:CustomFrequencyManagerService( &nbsp;677): acquireDVFSLockLocked : type : DVFS\_MIN\_LIMIT &nbsp;frequency : 1350000 &nbsp;uid : 1000 &nbsp;pid : 677 &nbsp;pkgName : ACTIVITY\_RESUME\_BOOSTER@6 W/ActivityManager( &nbsp;677): mDVFSHelper.acquire() D/WindowManager( &nbsp;677): computeScreenConfigurationLocked() set config.orientation=1 dw=1080 dh=1920 Callers=com.android.server.wm.WindowManagerService.updateOrientationFromAppTokensLocked:5171 com.android.server.wm.WindowManagerService.updateOrientationFromAppTokens:5142 com.android.server.am.ActivityStack.resumeTopActivityLocked:2761&nbsp; D/PowerManagerService( &nbsp;677): setKeyboardVisibility: false V/WindowManager( &nbsp;677): Window{435413d8 u0 Keyguard EXITING}mOrientationRequetedFromKeyguard=false E/ViewRootImpl( 2691): sendUserActionEvent() mView == null V/SmartFaceService - 3rd party pause( &nbsp;677): onReceive [android.intent.action.ACTIVITY\_STATE/com.facebook.katana/resume] E/EnterpriseContainerManager( &nbsp;677): ContainerPolicy Service is not yet ready!!! D/EnterpriseDeviceManager( &nbsp;677): ContainerId: 0 W/LicenseLogService( &nbsp;677): log() is called by non admin I/SurfaceFlinger( &nbsp;205): id=1085 Removed Gacebook (6/7) I/SurfaceFlinger( &nbsp;205): id=1085 Removed Gacebook (-2/7) E/MP-Decision( 1851): num online cores: 3 reqd : 2 available : 4 rq\_depth:2.100000 hotplug\_avg\_load\_dw: 88 E/MP-Decision( 1851): DOWN cpu:2 core\_idx:2 Ns:2.100000 Ts:240 total\_time\_down:245.000000 I/WindowManager( &nbsp;677): Screenshot Window{457ed1a0 u0 com.facebook.katana/com.facebook.katana.platform.PlatformActivity} was all black! mSurfaceLayer=21110 minLayer=21110 maxLayer=21110 V/SmartFaceService - 3rd party pause( &nbsp;677): onReceive [android.intent.action.ACTIVITY\_STATE/com.facebook.katana/pause] D/WindowManager( &nbsp;677): computeScreenConfigurationLocked() set config.orientation=1 dw=1080 dh=1920 Callers=com.android.server.wm.WindowManagerService.updateOrientationFromAppTokensLocked:5171 com.android.server.wm.WindowManagerService.updateOrientationFromAppTokens:5142 com.android.server.am.ActivityStack.resumeTopActivityLocked:2761&nbsp; D/PowerManagerService( &nbsp;677): setKeyboardVisibility: false V/WindowManager( &nbsp;677): Window{435413d8 u0 Keyguard EXITING}mOrientationRequetedFromKeyguard=false D/PointerIcon( &nbsp;677): setHoveringSpenIconStyle1 pointerType: 10001iconType:1 flag:0 D/PointerIcon( &nbsp;677): setHoveringSpenCustomIcon IconType is same.1 D/STATUSBAR-PhoneStatusBar( 1037): animateCollapsePanels V/SmartFaceService - 3rd party pause( &nbsp;677): onReceive [android.intent.action.ACTIVITY\_STATE/com.seaburngames.games.helicopter\_bob/resume] D/dalvikvm( &nbsp;677): GC\_FOR\_ALLOC freed 4336K, 20% free 75543K/93836K, paused 133ms, total 134ms I/SurfaceFlinger( &nbsp;205): id=1086 Removed QlatformWra (4/6) I/SurfaceFlinger( &nbsp;205): id=1086 Removed QlatformWra (-2/6) D/PointerIcon( &nbsp;677): setHoveringSpenIconStyle1 pointerType: 10001iconType:1 flag:0 D/PointerIcon( &nbsp;677): setHoveringSpenCustomIcon IconType is same.1 D/STATUSBAR-StatusBarManagerService( &nbsp;677): manageDisableList what=0x0 pkg=WindowManager.LayoutParams E/EnterpriseContainerManager( &nbsp;677): ContainerPolicy Service is not yet ready!!! D/EnterpriseDeviceManager( &nbsp;677): ContainerId: 0 W/LicenseLogService( &nbsp;677): log() is called by non admin D/SSRMv2:AirViewOnOff( &nbsp;677): DeviceInfo:: 0000000000 D/SSRMv2:AirViewOnOff( &nbsp;677): SettingsAirViewInfo:: 000000000 D/SSRMv2:AirViewOnOff( &nbsp;677): DeviceInfo:: 0000000000 D/SSRMv2:AirViewOnOff( &nbsp;677): SettingsAirViewInfo:: 000000000 V/SmartFaceService - 3rd party pause( &nbsp;677): onReceive [android.intent.action.ACTIVITY\_STATE/com.seaburngames.games.helicopter\_bob/pause] W/InputMethodManagerService( &nbsp;677): Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@44b10340 (uid=10074 pid=23464) V/InputMethodManagerService( &nbsp;677): Focus gain on non-focused client mCurClient info is ClientState{43718b78 uid 10214 pid 2691} I/SurfaceFlinger( &nbsp;205): id=1084 Removed QlatformAct (3/5) I/SurfaceFlinger( &nbsp;205): id=1084 Removed QlatformAct (-2/5) V/WindowOrientationListener( &nbsp;677): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false V/WindowOrientationListener( &nbsp;677): mSContextAutoRotationListener.getProposedRotation, Rotation: -1 V/WindowOrientationListener( &nbsp;677): mSContextAutoRotationListener.getProposedRotation, mbResultFaceDectection: false V/WindowOrientationListener( &nbsp;677): mSContextAutoRotationListener.getProposedRotation, Rotation: -1 V/WindowManager( &nbsp;677): rotationForOrientationLw(orient=1, last=0); user=0 &nbsp;sensorRotation=-1 isCoverOpen=true mLidState=-1 mDockMode=0 mHdmiPlugged=false mAccelerometerDefault=false V/WindowManager( &nbsp;677): Application requested orientation 1, got rotation 0 which has compatible metrics D/WindowManager( &nbsp;677): computeScreenConfigurationLocked() set config.orientation=1 dw=1080 dh=1920 Callers=com.android.server.wm.WindowManagerService.updateOrientationFromAppTokensLocked:5171 com.android.server.wm.WindowManagerService.updateOrientationFromAppTokens:5142 com.android.server.am.ActivityStack.resumeTopActivityLocked:2761&nbsp; D/PowerManagerService( &nbsp;677): setKeyboardVisibility: false D/SensorService( &nbsp;677): info.rates.add, set DEFAULT\_EVENTS\_PERIOD E/Sensors ( &nbsp;677): Acc old sensor\_state 0, new sensor\_state : 1 en : 1 D/SensorService( &nbsp;677): SensorDevice::activating sensor handle=0 ns=200000000&nbsp; V/SmartFaceService - 3rd party pause( &nbsp;677): onReceive [android.intent.action.ACTIVITY\_STATE/com.seaburngames.games.helicopter\_bob/resume] I/SensorService( &nbsp;677): info.selectDelay() ns=200000000 &nbsp; D/SensorService( &nbsp;677): SensorDevice::setDelay, Return(true 1, false 0) = &nbsp;1 D/SensorManager(23464): registerListener :: create queue :: handler = 0, name = K330 3-axis Accelerometer, delay = 200000,&nbsp; I/SurfaceFlinger( &nbsp;205): id=1087 createSurf (1080x1920),1 flag=4, TurfaceView I/SurfaceFlinger( &nbsp;205): id=1088 createSurf (1080x1920),1 flag=4, DoronaActiv &nbsp;

The error can be summed up in this one line:

_ com.facebook.http.protocol.ApiException: Key hash JGn9F2vDQ_w6hexLxdefCUpxYIA does not match any stored key hashes _

Your hash of your keystore isn’t correct.  What you put in your developer profile has to match the actual keystore you are building with.  If you read this tutorial, it should clear this issue up.

http://coronalabs.com/blog/2013/07/30/understanding-facebook-authentication/

Rob

In that case does it the hash change if you build on windows or mac? my original key hash was created on a windows ps and a windows corona build, I’m using mac now.

Kevin

PS I’m using :

keytool -exportcert -alias androiddebugkey -keystore ~/Applications/CoronaSDK/Resource Library/Android/debug.keystore | openssl sha1 -binary | openssl base64

to create a new key on mac this is correct ? 

Kevin

I don’t know if the keystore we ship on Windows is different than on the Mac or not.  I would think the key hash generation would produce the same value regardless of platform, if the keystore’s were the same.

That command looks correct to generate a keyhash of the default Corona SDK debugkeystore.

Rob

Hi Rob does the Class Name:com.ansca.corona.CoronaActivity change if you use your one keystore/keyhash ? 

Kevin

No, that field should always be com.ansca.corona.CoronaActivity.