Android Facebook after build CoronaSDK 2013.1076

Dear Corona,

Every build after: CoronaSDK 2013.1076 currently breaks facebook for android.

We are using the documented samples and previous working versions, asking for extended permissions (“publish_stream” for example), does not work.

Facebook shows a different login system than previous build (it shows a pup up message instead of taking the user to the facebook application.

If the user authenticates the application does not return any access token.

IT works fine for basic info like email but breaks on publish_stream.

We tried the same on build 1076 and it works fine.

The log show weird errors:

com.facebook.http.protocol.ApiException: The proxied app cannot request publish permissions without having being installed previously.

W/fb4a(:<default>):GDPDialog( 3874): Failed to send

W/fb4a(:<default>):GDPDialog( 3874): com.facebook.fbservice.service.ServiceException: API_ERROR: API_ERROR

Dear corona team,

we used older builds to get this fixed. But now Facebook is giving warnings:

Your app asks for read and write permissions at the same time. You should only ask for write permissions when a user tries to share something to Facebook. Please update your app accordingly. Read our best practices for more details.

Please fix FB on latest builds so we can use it on android.

Thanks

Hi @Mercury Media,

Which specific build of Corona are you using now? Mac or PC? We need this basic info to help diagnose the issue.

Thanks,

Brent

In addition to Brent’s request, can you try and build the Facebook sample app?  The sample app shipping with all builds since 1076 should be working.

everything after 1076 till 1146 did not work producing the same error listed above.

Facebook now requests separate permissions for read and write.

We used 1076 which only supported asking permission once.

We will retry with the latest build.

Thank you.

Using today’s daily build, I built the standard facebook sample app that we provide and it posted a photo to my timeline.  If you are having Facebook errors, please try and build the sample app, use your AppID. 

Hi rob 

      We are facing issue with the Facebook post photo in android . I was able to post the message if there is no facebook app on the android phone .If there is a Facebook app the post photo is not at all working for android. Whats the issue with the Facebook app.Any one else facing the same issue .Please post .

Please reply us and tell us the solution for this .

@info8888 have you built and tested the sample app?

Are you getting any errors in your console log (use:  adb logcat       to view…)

Have you gone through the facebook setup guide:   http://docs.coronalabs.com/guide/social/setupFacebook/index.html

Does your keystore match what Facebook is watching (will have an error in your console log)

Hi rob 

    Here we are giving the log messages but if keystore or app id is wrong it should not work with the normal browser of facebook but with that its getting posted.(Its not working only when the facebook app is there in the android mobile).Here is the log.

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345): Exception during service

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345): com.facebook.http.protocol.ApiException: remote_app_id does not match stored id 

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.http.protocol.ApiResponseChecker.b(ApiResponseChecker.java:78)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.http.protocol.ApiResponseChecker.a(ApiResponseChecker.java:107)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.http.protocol.ApiResponse.h(ApiResponse.java:291)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:266)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.katana.server.protocol.AuthorizeAppMethod.a(AuthorizeAppMethod.java:27)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.http.protocol.SingleMethodRunnerImpl.a(SingleMethodRunnerImpl.java:157)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.http.protocol.AbstractSingleMethodRunner.a(AbstractSingleMethodRunner.java:16)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.katana.server.handler.PlatformOperationHandler.c(PlatformOperationHandler.java:366)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.katana.server.handler.PlatformOperationHandler.a(PlatformOperationHandler.java:259)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:245)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.fbservice.service.BlueServiceQueue.d(BlueServiceQueue.java:51)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.fbservice.service.BlueServiceQueue$3.run(BlueServiceQueue.java:191)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:444)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at com.facebook.common.executors.HandlerExecutorServiceImpl$ListenableScheduledFuture.run(HandlerExecutorServiceImpl.java:268)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at android.os.Handler.handleCallback(Handler.java:587)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at android.os.Handler.dispatchMessage(Handler.java:92)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at android.os.Looper.loop(Looper.java:130)

07-13 07:24:00.559: W/fb4a(:<default>):BlueServiceQueue(23345):     at android.os.HandlerThread.run(HandlerThread.java:60)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345): Failed to send

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345): com.facebook.fbservice.service.ServiceException: API_ERROR: API_ERROR

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at com.facebook.fbservice.ops.BlueServiceOperation.c(BlueServiceOperation.java:637)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at com.facebook.fbservice.ops.BlueServiceOperation.c(BlueServiceOperation.java:46)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at com.facebook.fbservice.ops.BlueServiceOperation$2.run(BlueServiceOperation.java:602)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at android.os.Handler.handleCallback(Handler.java:587)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at android.os.Handler.dispatchMessage(Handler.java:92)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at android.os.Looper.loop(Looper.java:130)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at android.app.ActivityThread.main(ActivityThread.java:3687)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at java.lang.reflect.Method.invokeNative(Native Method)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at java.lang.reflect.Method.invoke(Method.java:507)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)

07-13 07:24:00.569: W/fb4a(:<default>):GDPDialog(23345):     at dalvik.system.NativeStart.main(Native Method)

This seems like a place I would check:   remote_app_id does not match stored id

You pass an AppID to the facebook.init() call and that needs to match what you have setup on the Facebook Developer portal.  I would start by making sure you have all of those values correct. 

Facebook’s setup is overly complex in my opinion and they change things way too often.  In fact about once a quarter they “break” things seemingly on purpose.

Same issue with latests builds :frowning:

Corona should provide us access to request additional permission to facebook (see latest facebook breaking changes and related documentation)

The tutorial is outdated. I get the same errors posted above (both of them). From what I searched over the internet they are actually because of the invalid hash key.

I tried to find the problem and I posted what I found in this other thread (http://forums.coronalabs.com/topic/37173-facebook-key-hashes-no-longer-required-for-android/)

Any ideas?

A quick note to let you know that I checked to see if my FB integration broke with the daily build 1158, and I’ve verified it is working fine with mine.

I wonder what might be causing this issue…

Naomi

Not sure if this is how we should officially use fb from now on, but I found a fix for it:

http://forums.coronalabs.com/topic/37173-facebook-key-hashes-no-longer-required-for-android/

     Thanks for replying. The values i am passing are correct and i am  confident about it because if i remove the facebook app from mobile its getting posted . If we fbapp then only its not working .Please solve the issue i tried to fix what beckslash had told us but still the same issue . Even if we keep 123 in our keyhash field of fb developer account  its not giving the exact keyshash in the log .

Thanks 

@info8888 You won’t be able to see the hash key into the logs. You have to generate that yourself from the console.

But even if you have it right you first need to authenticate the user for reading permissions, then for writing. You can no longer do it with only one call.

When you don’t have FB app installed, the configuration from facebook portal doesn’t matter at all. So that’s not a sign that you have the right hash.

Did you use this code?

keytool -exportcert -alias YOUR_APP_ALIAS -keystore YOUR_KEYSTORE.keystore | openssl sha1 -binary | openssl base64

And enter your password for the keystore and not “android”.

If you’re developing on windows make sure you have the right (latest I think) openssl version. Different versions give you different outputs.

Hi 

    Right now the it was able to post once we accept the app permissions through browser but if we are doing it for the first time which fb app installed its going to the share and asking would like to on u r behalf and messaging is not getting posted at all .The problem is only with the android builds. It is not asking for the acess permissions. Could you please help.

Dear corona team,

we used older builds to get this fixed. But now Facebook is giving warnings:

Your app asks for read and write permissions at the same time. You should only ask for write permissions when a user tries to share something to Facebook. Please update your app accordingly. Read our best practices for more details.

Please fix FB on latest builds so we can use it on android.

Thanks