Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

facebook login Corona
Started by tania_gh2000 Aug 03 2016 04:00 AM

- - - - -
26 replies to this topic
[TOPIC CONTROLS]
Page 1 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

Hola,

Estoy intentado compartir en facebook los resultados del juego. He creado un botón que al pulsarlo te loguea y al probarlo me sale el mensaje de error que podéis ver en la imagen.

Este es mi build.settings y nose que más probar porque si intento hacer el build cambiando el publisherId = "com.coronalabs" a publisherId = "com.facebook.LoginActivity" ni siquiera me deja hacer el build porque me da un error.

Por favor, ncesito ayuda

 

settings =
{
        -- Configuracion Google Play con Corona SDK
        plugins =
        {
             ["CoronaProvider.gameNetwork.google"] =
                {
                    publisherId = "com.coronalabs",
                    supportedPlatforms = { android=true }
                },
             ["facebook"] =
                {
                    publisherId = "com.coronalabs"
                },
        },
        orientation =
        {
                default = "portrait",
                supported =
                {
                        "portrait"
                },
        },
        android =
        {       
                -- Especificar ID de la aplicación 
                googlePlayGamesAppId = "159279571213",
                versionCode = "14",
                -- versionCode = "14", Esta es la version anterior si subimos nueva debe ser mayor
                facebookAppId = "902543416507297",
                usesPermissions =
                {
                        "android.permission.INTERNET",
                        "android.permission.WRITE_EXTERNAL_STORAGE",
                        "android.permission.VIBRATE"
                },
        },
}

Attached Files



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

Can you try again? We have tweaked something on our servers that should fix this. It may take a few minutes to propagate through all of the servers.

 

Posts to main forum topics should be in English. We have a forum specific for Spanish speakers where you can ask questions in Spanish.

 

Thanks

Rob



[TOPIC: post.html]
#3

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

Hello thank you very much.

I test well with com.coronalabs ? or I have to change something in build.settings?

Best regatas!

[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

Your build.settings looks fine.

 

Are you still getting the error?

 

Rob



[TOPIC: post.html]
#5

koxontko

[GLOBAL: userInfoPane.html]
koxontko
  • Observer

  • 1 posts
  • Corona SDK

Hi i´m Tania_gh2000 from other account . i cant access to my account i dont understand.

 

 

The first time I've tried has worked perfectly but the second has left me this error message :

"Invalid key hash. The key hash icbj8sAOK4GRJ2jHI3En5zdH2Ss= does not match any stored key hashes. Configure your app key hashes at http://developers.facebook.com/apps/902543416507297 "

I had already generated my key hash why ask me that now?my key hash is diferent.

Can you help me?

Thank you very much .

Regards

tania [10:57 AM] the first time I've tried has worked perfectly but the second test has left me this error message I sent in the image.
I had already generated my key hash why ask me that now? you can help me thank you very much .



[TOPIC: post.html]
#6

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

the first time I've tried has worked perfectly but the second time I see this error :

"Invalid hash key . The key hash xxxxxxxxxxxxxxxxxxx = " does not match

any stored key hashes. Configured your app key hashes at

http://developer.facebook.com/app/902xxxxxxxxx

 

 

I have already generated a hash key and is not the same

 

can you help me?

Thanks, regards

Tania.



[TOPIC: post.html]
#7

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

Please read: https://docs.coronalabs.com/guide/social/setupFacebook/index.html#android

under Key Hashes.

 

Basically Facebook tells you what it's expecting. Take what they put in the console log, make any changes per the document above and add that new string to your FB developer portal, removing any other keyhashes.

 

Rob



[TOPIC: post.html]
#8

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

I'm worried .. sorry .

I copied the hash key that appears in the error message and have put in the box hash key settings facebook developers .
I have also enabled a single sign-on and deep link and native application. package name as I have in the crown and the name of the class com.ansca.corona.CoronaActivity
but I still  the same error message . (
Please help me!



[TOPIC: post.html]
#9

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

Did you change the two special characters that need changed as documented in the link I provided?  Can you provide a screen shot from your developer platform and the exact message in your console log?

 

Rob



[TOPIC: post.html]
#10

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

Yes ofcourse, i dont know the mistake. 

here you can see the pics .

 

Thanks

Best regards,

Tania.

do I have to change ?



[TOPIC: post.html]
#11

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

You need to use the "adb logcat" command with your device tethered to your PC and look for the error there. It will tell you what you need to provide for the hash key. If you don't have the android developer tools installed, then read the guide below

 

http://docs.coronalabs.com/guide/basics/debugging/index.html

 

I need to see the error message in the console log.

 

Rob



[TOPIC: post.html]
#12

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

Hi Rob,

 

I have already installed the tools to use adb logcat. 

 

The problem is that I find the hash key . What I can do? I`m blocked.

 

Thanks for your help.

Tania.

 

 

Attached Files



[TOPIC: post.html]
#13

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

There should be text in the console log from Facebook that tells you that the hash key is bad. It should also tell you what it should be.  I need to see that text.

 

Rob



[TOPIC: post.html]
#14

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

Hi Rob!

 

I downloaded and installed the android tools. I connected my mobile phone to my computer and i have started the console using the command adb logcat.

The result i have saved in the text file called "ErrorClave.txt".

I can not find the error message with the hash key.

I attached the results so you can  help me.

 

Thanks!!

 

Tania.

I attached the results so you can help me.
 
.I downloaded and installed the android tools . I connected my mobile phone to your computer and have started the console using the adb logcat command. The result I have saved in the text file called " ErrorClave.txt " . I can not find the error message with the hash key .
I downloaded and installed the android tools . I connected my mobile phone to your computer and have started the console using the adb logcat command. The result I have saved in the text file called " ErrorClave.txt " . I can not find the error message with the hash key .
 
 
I downloaded and installed the android tools . I connected my mobile phone to your computer and have started the console using the adb logcat command. The result I have saved in the text file called " ErrorClave.txt " . I can not find the error message with the hash key .
 
I downloaded and installed the android tools . I connected my mobile phone to your computer and have started the console using the adb logcat command. The result I have saved in the text file called " ErrorClave.txt " . I can not find the error message with the hash key .
 
I downloaded and installed the android tools . I connected my mobile phone to your computer and have started the console using the adb logcat command. The result I have saved in the text file called " ErrorClave.txt " . I can not find the error message with the hash key .
 

 

Attached Files



[TOPIC: post.html]
#15

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

The text file wasn't helpful. For future reference it would be helpful to stop all other apps. There is a bunch of messages from whatsapp and an audio player that makes it hard to find messages. Also are you running on BlueStacks or an actual device?

 

Lets try this a different way. Are you building on Windows or a Mac?

Can you post a screen shot of the build screen just before you hit the button to start the build (please do not blur out any fields).

 

Thanks

Rob



[TOPIC: post.html]
#16

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

Hi!

 

I build on Windows. Yesterday I was examining the text document called "ErrorClave.txt " and filter the results facebook . I found the message saying the hash key was the same as that came in the screenshoot of the error message facebook , I have copied the settings of facebook developers and seems that already works .

 

 

How I can make a screenshot and upload it to the same capture on facebook? make screenshot and saved in pictures on mobile but my problem is not how to tell the name of the file I want to publish. this is the code:

 

 

Thanks Rob

 

Best regards,

Tania.

Attached Files



[TOPIC: post.html]
#17

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

I really could use to see a screen shot of your build screen where it shows me the Keystore and Alias information.  I'm going to have you break down each step of creating a key hash and see where the error is happening. The keyhash you have is invalid and we need to create one. Since we can't find where Facebook is supposed to tell you what to use, we have to do this. Once I have that screen shot, hopefully I can give you the exact commands needed to determine the problem.

 

Just to help you understand the process. The command in our guide is actually like three commands that are chained together. That is the output from the first command becomes the input to the second command. The output from the second becomes the input to the 3rd.

 

If there are any errors along the way (file not found, invalid password, etc.), you will get a keyhash output by the last step, but it won't be based on the keystore you're using. I'm going to have you execute the commands one at a time looking to see what the output is and where the problem is occurring, but I can't give you exact commands until I know where your keystore is and what alias you're using.

 

Rob



[TOPIC: post.html]
#18

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

Hello Rob,

 

Thank you very much for your attention.
Ok this is the build screen, I hope you can help me.


[TOPIC: post.html]
#19

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

I feel like I'm giving you the run around. But I need to learn more.  Can you send a screenshot of your Facebook Developer Portal where you've entered the keyhash?

 

Also, can you try our newer facebook plugin:  Change build.settings to use:

["plugin.facebook.v4"] =
{
    publisherId = "com.coronalabs"
},

and see if we get improved messaging in the console log. I would need you to re-capture the console log. Please turn off the music player and whatsapp before you capture the run. This will get a bulk of the messages out of the log run.

 

Thanks

Rob



[TOPIC: post.html]
#20

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

Hi!

 

Here I send screenshots you asked.

 

I have already changed build.settings with the new facebook plugin that you  has recommended me .

When starting the app , press the button to post on facebook and works perfectly the first time but the second does nothing and not get an error message.
 
I hope we finally get to fix it .
 
Thank you very much.
Best regards.
 
Tania.


[TOPIC: post.html]
#21

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

Well you seem to have gotten past the keyhash problem. Now your code is wanting to work with the old plugin and it needs updated to the new version. Please see the migration guide and adjust your code to the new way the plugin works.

 

Rob



[TOPIC: post.html]
#22

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

Hello Rob!

 

The problem is that it does not work in all cases.

Only the first time that you press it posted on facebook but other times it does nothing and gives no error.

 

On the other hand , I want to make a screenshot when the game is over and the results are shown and that capture upload it to facebook.

So:

   1. I use this statement to make screenshot : local capture = display.captureScreen()

   2. The capture is saved in the pictures folder on my device.

3. To publish that captures on facebook I try to use this instruction: facebook.request( "me/photos", "POST", capture ) but does not work.

Also, I have tried using this:

 

local attachment = { message = "My score!<3", source = { baseDir=system.DocumentsDirectory, filename= capture, type="image" } }

facebook.request( "me/photos", "POST", attachment )

 

 

        

        And it does not work . the problem that i dont know how tell the baseDir value variable to take the image of the pictures folder on my device and also not to put in filename . Really do not know if this can be done ....

 

 

In the facebook plugin documentation v4 I find nothing... I do not get it.

Can you write me a code example that I have to use please?

 

 

 

 

Thank you.

Tania.

 



[TOPIC: post.html]
#23

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

You probably want to use display.save() instead. This will create an image in a known sandbox directory:

display.save( display.currentStage, { filename="screenshot.png", baseDir=system.TemporaryDirectory, captureOffscreenArea=true, backgroundColor={0,0,0,0} } )
local attachment = { message = "My score!<3", source = { baseDir=system.TemporaryDirectory, filename="screenshot.png", type="image" } }
facebook.request( "me/photos", "POST", attachment )



[TOPIC: post.html]
#24

tania_gh2000

[GLOBAL: userInfoPane.html]
tania_gh2000
  • Observer

  • 23 posts
  • Corona SDK

Hello Rob,

 

I want to thank the help.

I want to ask one thing. In my code when you win a game in the end the box scores appears and also the button which you can share on facebook that score appears. 

 

The first time you press the button to share on facebook , share the image with the result without problems but later when you want to share the result of another level it is locked and the app stops.

 

 

I do not know if it is because the screenshot is always kept with the same name or the problem is in my code .. please can you help me? this is the code:

 

 


local botonfb =  display.newImage("images/fact.png")
   botonfb:setReferencePoint ( display.CenterReferencePoint )
   botonfb.x = imgRecords.x  
   botonfb.y = lbLifes.y + 90
   pause:insert ( botonfb )
 
local function listener( event )
      
       print( "event.name:" .. event.name )  --"fbconnect"
       print( "isError: " .. tostring( event.isError ) )
       print( "didComplete: " .. tostring( event.didComplete ) )
       print( "event.type:" .. event.type )  --"session", "request", or "dialog"
 
       if(event.phase == "release") then
           facebook.login( appId, listener )
       end

       if ( "session" == event.type ) then

           --options are "login", "loginFailed", "loginCancelled", or "logout"
           if ( "login" == event.phase ) then
               display.save( display.currentStage, { filename="screenshot.png", baseDir=system.TemporaryDirectory, captureOffscreenArea=true, backgroundColor={0,0,0,0} } )
                local attachment = { message = "This is my score achieved in Dogchild! <3 Can you get better?", source = { baseDir=system.TemporaryDirectory, filename="screenshot.png", type="image" } }
                facebook.request( "me/photos", "POST", attachment )
           end
 
           elseif ( "request" == event.type ) then
              print("facebook request")
            if ( not event.isError ) then
               local response = json.decode( event.response )
 
            end
 
           elseif ( "dialog" == event.type ) then
               print( "dialog", event.response )
          
           end
end
 
 
local function loginFace( event )
       facebook.login( appID, listener, { "publish_actions", "user_birthday" } )
end
 
botonfb:addEventListener( "touch" , loginFace )

 

 

 

As always thank you very much.

Tania.

Attached Files

  • Attached File  code.png   67.47KB   0 downloads


[TOPIC: post.html]
#25

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,400 posts
  • Enterprise

What would be more helpful is the contents of your console log. 

 

Rob




[topic_controls]
Page 1 of 2 1 2
 
[/topic_controls]