-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentException when use FB.API in Unity 2021.1 #537
Comments
The issue is caused by legacy |
Same. How can I upgrade to UnityWebRequest? |
@JustKoTMurchik, you need to patch |
@Velorth Thx! |
+1 |
3 similar comments
+1 |
+1 |
+1 |
Any update? |
Any fix?... |
What do You mean with "patch"? I would assume i need to compile some DLLs. Is that correct? I tried downloading develop branch, resolve dependency issues, build and replace every DLL of the SDK in my project. but didn't worked. |
@Velorth I have tried to build both your forked dev branch and facebook-sdk-for-unity dev branch with your changes. Have you ever build your dev branch successfully? |
I got success building them. THey just need some nuget references. Every thing build fine here. But once i try to put the DLLs on my unit project there is no FB.Mobile.something in FB.Mobile. SO not sure what is happening. |
I'm new to GitHub. What we can make for this to make a release ASAP? |
@farahjr, dev branch looks a little bit outdated and it is not compatible with examples in master branch. So there isn't any public class in FB.Mobile and Graph API version is set to unsupported v3.0. |
Replace the code that has been done in https://github.com/facebook/facebook-sdk-for-unity/pull/539/files and compile the projet "Facebook.Unity" Then replace the DLL in your Unity projet. It works. Contact me if you want the DLL. I just built it right now using Unity 2021.1.5 DLLs and the login worked again. It is just a workaround until they do it. |
With the help of @visualbruno, I have fixed the problem. Facebook SDK team please fix this bug when you have time because this bug makes your SDK unusable with Unity 2021 |
Yes please I am waiting also 🙏🙏 |
The pull request that @Velorth created breaks the support for Unity less than 2017.1 .. that is bad because according to Facebook Unity SDK page they mention that it Requires Unity 5.4 and up. If Facebook still wants to support 5.4 they can't accept that pull request unchanged. |
@snorrsi The backward compatibility problem that you mentioned is easy to fix with Platform dependent compilation directives.
|
That might explain my current problem. I got success integrating with Firebase and facebook at Editor runtime, but when building and deplying on my phone, i Got an oauth error: 2021/05/06 10:23:52.243 16976 21572 Error GraphResponse {HttpStatus: 400, errorCode: 200, subErrorCode: -1, errorType: OAuthException, errorMessage: An access token is required to request this resource.} I will try fetching master and patching only the changes withing this commit. |
@kerembaydogan, conditional compilation is not an option because there are lots of users that use Facebook SDK as a pre-built binary package. According to the Unity docs UnityWebRequest was introduced in Unity 5.4. I will check if it realy works and what can we do if it doesn't. |
@Velorth Yeah you are right, that wont work if they continue to release single sdk package. Maybe they build/release multiple sdk packages from the same code base using directives and support both old and new unity versions? BTW when unity removes UnityWebRequest they have to find a way. |
To get it working, I deleted the Facebook.Unity.dll file and replaced it by the Facebook.Unity source folder then corrected the errors in the C# code. |
Hi @samavan, In the FacebookSDK/Plugins folder, I just deleted the Facebook.Unity.dll file, then dropped the folder highlighted on your screenshot in that folder. |
Hmm what I did but getting errors... |
Thanks! Worked a charm! Project compiles fine :) And then also project builds fine after re-opening every single scenes from the Examples directory as mentioned the error logs here : #552 |
Did you replace WWW by UnityWebRequest ? |
Hi i need DLL. Please share it |
Hi
You can download them here : https://www.dropbox.com/sh/rh1r4vbevpcmq55/AAAlqW7biGD0fMQUhNzXI1B3a?dl=0
I compiled them using Unity 2021.1.5.
Regards
Bruno
Provenance : Courrier<https://go.microsoft.com/fwlink/?LinkId=550986> pour Windows 10
De : Indra Kumar ***@***.***>
Envoyé le :lundi, 17 mai 2021 17:29
À : ***@***.***>
Cc : Bruno ***@***.***>; ***@***.***>
Objet :Re: [facebook/facebook-sdk-for-unity] ArgumentException when use FB.API in Unity 2021.1 (#537)
Replace the code that has been done in https://github.com/facebook/facebook-sdk-for-unity/pull/539/files and compile the projet "Facebook.Unity"
Then replace the DLL in your Unity projet. It works.
Contact me if you want the DLL. I just built it right now using Unity 2021.1.5 DLLs and the login worked again.
Tested in Editor and Android. I don't know for IOS.
It is just a workaround until they do it.
Hi i need DLL. Please share it
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#537 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAC7CQHYS6INJVZWF3ZW5MDTOEY7HANCNFSM4ZZTHDZQ>.
|
Thank you working fine! |
Thanks its Working Fine :) |
Thanks, it solved my issue with FB sign-in, but share function doesn't return anything (just FacebookDelegate isn't called). Anyone with the same? |
New version of Facebook SDK for Unity released just a few days ago (v11.0.0) and the issue hasn't been solved. Tested with Unity 2021.1.11f1. |
I built the DLLs for Facebook SDK v11.0 @pacolaf |
Thanks for new dll, but that didn't solve problem with "share" function unfortunately. Callback ShareResult is always Cancelled |
Thank you! It solves the login problem. I don't use the "share" function either, so I cannot test it. |
Hi @wingsmight |
Hey, yeah, I did exactly what you wrote, but ShareLink returns right value only on Android. On iOS FB always returns cancelled. |
@wingsmight Someone created an issue about this bug: #553 |
wow, amazing nobody not only tested the sdk at Facebook but also that the fix didn't make it into the last update. You can tell how seriously fb is taking unity XD |
It seems that the bug is solved, not by Facebook but by Unity. Facebook SDK for Unity v11.0.0 (original) finally working on Unity 2021.1.15f1, at least with my app. Can anybody confirm this? EDIT: Also working with Facebook SDK v9.0.0. |
Well spotted @pacolaf . I haven’t tested this myself but when reading through Unity 2021.1.15 release notes it lists fix for UploadHandlerRaw now accepting null values in Post request. I suspect the issue of getting user image from FB.Api was using null in parameter for the UploadHandlerRaw method which makes FB SDK now finally usable with 2021.1.15+ |
Checklist
Environment
Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:
2021.1.0f1
9.0
Goals
I try to use FB.API to query user picture with GET request.
Expected Results
OnResult callback should be invoked in any case (success or error).
Actual Results
OnResult callback is never invoked.
Stack trace:
Steps to Reproduce
Code Samples & Details
The text was updated successfully, but these errors were encountered: