관리 메뉴

도드넷

유니티 페이스북 로그인 SDK 오류 : Facebook app client token must be set in the androidmanifest.xml / one or more of the given urls is not allowed by the app's settings 본문

창고/게임 개발 [Hidden]

유니티 페이스북 로그인 SDK 오류 : Facebook app client token must be set in the androidmanifest.xml / one or more of the given urls is not allowed by the app's settings

도드! 2023. 2. 4. 11:27
반응형

 

유니티 페이스북 SDK 로그인 만드는 도중 만나게된 두가지 오류사항에 대한 해결법 기록.

 

1. Facebook app client token must be set in the androidmanifest.xml

>> 원인 : SDK 설치하고 정작 유니티에서 설정 재대로 안함. (패북 앱에서의 아이디, 토큰 필요.)

 

2. one or more of the given urls is not allowed by the app's settings

to use this url you must add a valid native platform

>> 원인 : 페북 앱 대시보드에서 플랫폼 안넣음.

 

1. SDK 설치.

https://developers.facebook.com/docs/unity/

 

2. 유니티 상단메뉴 Facebook 메뉴 열고 앱 이름, 앱 아이디, 토큰 설정하기.

https://developers.facebook.com/apps

 

들어가면 앱아이디가 바로 나오고 토큰은 고급설정 > 클라이언트 토큰 복붙ㄱㄱ

 

3. 대시보드 > 설정 > 기본설정 들어가서 플랫폼 추가하기 클릭. (맨아래에 있음).

 

4. 패키지 이름은 그냥 com.xxx.xxx 넣으면되고 키 해시를 달라고 하는데 이건 저번에 구글플레이 로그인에 사용된 keystore에서 얻어낸것 처럼 명령어 입력해서 해쉬값 구해서 넣어주면됨.

(참고문서 : https://developers.facebook.com/docs/android/getting-started/)

(참고문서 : https://dodnet.tistory.com/4765)

 

 

+추가글

keytool -exportcert -alias <RELEASE_KEY_ALIAS> -keystore <RELEASE_KEY_PATH> | PATH_TO_OPENSSL_LIBRARY\bin\openssl sha1 -binary | PATH_TO_OPENSSL_LIBRARY\bin\openssl base64

JAVA 툴을 이용해서 위의 커맨드를 입력, 해쉬 키를 얻어서

대시보드 > 설정 > 기본설정 > 플랫폼추가에 입력하고 테스트했는데 만약에

INVALID KEY HASH 라는 메시지가 나올 경우 그 오류 메시지에 적혀있는 해쉬키를 꼬박꼬박 옮겨적어서

패북 앱 대쉬보드에 입력해주면 정상 작동한다.

 

(WHAT THE F..? 그래도 잘 작동하니까 OK...?)

 

 

++추가글

페이스북 오토 로그인 기능 (FB.Android.RetrieveLoginStatus) 을 사용하려고하는데

Failure: Access Token could not be retrieved

오류가 발생한다? 이건 페이스북 앱이 설치되지 않아서 발생하는 일이다.

페이스북 앱 활성화가 필수인 기능이다. ㅠ.ㅠ

반응형
Comments