简体   繁体   English

Unity IOS的​​facebook api中的“被玩家取消登录”回调(仅当设备中具有facebook应用程序时)

[英]“Login cancelled by player” callback in facebook api for Unity IOS (only if you have facebook app in device)

I am using unity facebook api 4.3.6 for ios. 我正在为iOS使用Unity Facebook API 4.3.6。 Its working perfectly fine if I don't have #facebookapp in my device. 如果我的设备中没有#facebookapp,它的运行效果会很好。 Once I download it and try login, it takes me to #facebookapp and redirect again to my game with callback 下载并尝试登录后,它将带我到#facebookapp并再次通过回调重定向到我的游戏

FB Login callback : {"is_logged_in":false, "user_id":"", "access_token":""} Login cancelled by player FB登录回调:{“ is_logged_in”:false,“ user_id”:“”,“ access_token”:“”}}玩家已取消登录

This happens only if I have facebook app downloaded! 仅当我下载了Facebook应用程序时才会发生这种情况! I think its some how cache issue but not sure exactly what is it. 我认为这是一些缓存问题,但不确定到底是什么。 Any luck? 运气好的话?

I believe this is not connected with Unity. 我相信这与Unity无关。 Here is few reasons I faced 这是我面临的几个原因

  1. You need to ask read and write permissions separately. 您需要分别询问读写权限。 Wait until you get read permissions than send request for write permission. 等待直到获得读取权限,然后再发送请求写入权限。

  2. Make sure your app is allowed to login ( if you have FB app installed on your device ) 确保允许您的应用登录(如果您的设备上安装了FB应用)

  3. Make sure you have your app bundle identifier added to developer.facebook.com 确保您已将您的应用捆绑包标识符添加到developer.facebook.com

Here is what helped me fixed that problem with Unity Facebook-Android. 这是帮助我使用Unity Facebook-Android解决此问题的原因。

setting the sandbox mode ON: 将沙盒模式设置为“开”:

  1. Go to https://developers.facebook.com/apps 转到https://developers.facebook.com/apps
  2. Select the respective app from the drop down. 从下拉列表中选择相应的应用。
  3. Go to 'Status & Review' from the table in the left side of the page. 从页面左侧的表转到“状态与检查”。
  4. Do you want to make this app and all its live features available to the general public? 您是否要向公众提供此应用程序及其所有实时功能? - Select switch to set YES/NO value. -选择开关以设置是/否值。

if the ON/OFF button is disable, please go back to Settings and enter a valid email address. 如果“打开/关闭”按钮被禁用,请返回“设置”并输入有效的电子邮件地址。

I understood why when the device is installed a facebook app, my app can't login facebook. 我了解为什么在设备上安装Facebook应用程序后,我的应用程序无法登录Facebook。

  • First : software OpenSSL create keyhass wrong. 首先:软件OpenSSL创建密钥错误。 I have downloaded OpenSSL from here : http://code.google.com/p/openssl-for-windows/downloads/list , and it creates keyhash wrong. 我已经从此处下载了OpenSSL: http : //code.google.com/p/openssl-for-windows/downloads/list ,它创建了错误的密钥哈希。 I have used other OpenSSL sofware, you can download it here : https://www.dropbox.com/sh/t6tt44dc2nm6vza/6mp1W74GiZ , it is create keshash right. 我使用了其他OpenSSL软件,您可以在这里下载: https ://www.dropbox.com/sh/t6tt44dc2nm6vza/6mp1W74GiZ,它是正确创建keshash的。

  • Second: In class FacebookAndroidUtil.cs , line 62, you add System.Environment.GetEnvironmentVariable("HOMEDRIVE") before System.Environment.GetEnvironmentVariable("HOMEPATH"). 第二个:在类FacebookAndroidUtil.cs的第62行中,在System.Environment.GetEnvironmentVariable(“ HOMEPATH”)之前添加System.Environment.GetEnvironmentVariable(“ HOMEDRIVE”)。 Facebook SDK requires a file debug.keystore in : C:\\Users\\UserName.android\\debug.keystore. Facebook SDK需要在C:\\ Users \\ UserName.android \\ debug.keystore中的文件debug.keystore。 If the Unity Editor, Edit Setting Facebook has yet to create android debug hash key. 如果是Unity编辑器,则Edit Setting Facebook尚未创建android debug hash key。 Then use the Eclipse Software, create and run onr any project. 然后使用Eclipse软件,创建并运行任何项目。 Eclipse will generate a debug.keystore. Eclipse将生成一个debug.keystore。 If it is't create in folfer : C:\\Users\\UserName.android\\debug.keystore , then find it, coppy and paste into C:\\Users\\UserName.android\\debug.keystore 如果不是在以下文件夹中创建的:C:\\ Users \\ UserName.android \\ debug.keystore,然后找到它,复制并粘贴到C:\\ Users \\ UserName.android \\ debug.keystore

  • Third: publish your app in Facebook, so be sure it is:"This app is public and available to all users". 第三:在Facebook中发布您的应用程序,因此请确保它是:“此应用程序是公开的,可供所有用户使用”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在设备上运行应用程序时,iOS Facebook SDK“用户取消登录”? - iOS Facebook SDK “user cancelled login” when running app on device? Facebook登录iOS应用程序 - Facebook login in iOS app iOS设备上的Facebook登录失败 - facebook login failure on iOS device Facebook Unity SDK iOS登录未使用系统级登录,而是使用浏览器或Facebook应用 - Facebook Unity SDK iOS login is not using system level login but uses browser or facebook app IOS中的Facebook登录可以在模拟器上运行,但不能在安装了本机应用程序的设备上运行 - Facebook login in IOS works on emulator but not on device with native app installed 一台设备上的多个用户可在iOS应用中使用Facebook登录 - Facebook login in iOS app for multiple users on one device 此应用程序的开发人员尚未针对iOS中的Facebook登录正确设置此应用程序? - The developers of this app have not set up this app properly for Facebook Login in iOS? Facebook 登录总是被取消。 (iOS Swift) - Facebook login always comes back as cancelled. (iOS Swift) Facebook登录您已授权APP_NAME - Facebook Login You have already authorised APP_NAME 如何使用iOS 9中预装的Facebook应用程序登录Facebook - how to login with Facebook with preinstalled facebook app in iOS 9
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM