2014-04-24 6 views
0

코로나에서 게임을 빌드하기 위해 안드로이드 용 키 해시를 만들면서 모든 단계를 저했습니다. 나는 사용자 로그인 페이스 북 계정을위한 버튼을 만들었다. 그러나 사용자가 버튼을 터치 할 때 어떤 오류 메시지 및 응답도하지 마십시오. 인쇄물 만 출력하십시오.코로나 SDK에서 facebook.login()이 작동하지 않습니다.

무엇이 누락 되었습니까? 도와주세요. 난은 OpenSSL을 사용하여 키 해시를 만들도록

  • 가와 "딥 링크"
  • 입력 "단일 사인온"을 사용 페이스 북 개발자에 키 해시를 입력 페이스 북 개발자에서 앱 ID를 입력
  • 이 build.settings에서 "android.permission.INTERNET은"를 포함
  • 클래스 이름 페이스 북 개발자의 "com.ansca.corona.CoronaActivity"
이 문제를 해결 한 경우

local facebook = require ("facebook") 
local fbAppID = "49911xxxxxx" 

local function onClick(event) 
    if ("ended" == event.phase) then 
    print("Button was pressed and released") 
    facebook.login(fbAppID, facebookListener, { "publish_actions, email" }) 
    end 
end 

-- Facebook Button 
FacebookButton = widget.newButton 
    { 
    defaultFile = "images/fb.png" , 
    width = 240, 
    height = 120, 
    onEvent = onClick, 
    } 
FacebookButton.x = display.contentWidth/2 
FacebookButton.y = display.contentHeight/2 

답변

0

나는 확실하지 오전하지만 난 너무이 문제가되고있다. Facebook을 통해 로그인하면 다음과 같은 오류 메시지가 표시됩니다.

"잘못된 키 해시 코드는 xxxxxxxxxxxxx와 (사용자의 웹 사이트에서) 일치하지 않습니다."해시 코드를 복사 한 후 확인했습니다. 다시 ...

소문자 "L"이 실제로 대문자 "i"O.0 이었음을 깨달을 때까지만! 나중에 행운을 빌어 요! 또한 여기에 약간 도움이되는 작은 코드 스 니핏이 있습니다.

local function facebookListener(event) 
    if (event.type == "session") then 
     if (event.phase == "login") then 
      sessionToken = event.token 
      local response = event.response 
      native.showAlert("My Response", response) 
      --facebook.request("me", "GET", {fields = "email"}) 
     elseif (event.type == "request") then 
      local response = event.response 
      native.showAlert("My Response", response) 
     end 
    end 
end 
facebook.login(appId, facebookListener, {"publish_actions, email, public_profile"}) 
관련 문제