Search Unity

Resolved winsdkfb can't be load in unity

Discussion in 'Windows' started by rekatha, May 23, 2021.

  1. rekatha

    rekatha

    Joined:
    Dec 18, 2017
    Posts:
    22
    Hello, I want to implement facebook login in Unity for UWP. All I know is I need winsdkfb to do it. So I need help about how to add winsdkfb to unity.
    I've read some of old thread about integrated winsdkfb to unity. But none of them resolve my problem.

    What I've done:
    • I download the dll from here https://www.nuget.org/packages/winsdkfb/
    • I add the winsdkfb.dll to Assets\Plugins ( in the Inspector pane I Deselect “Any Platform” and select Editor instead)
    • I add the winsdkfb.winmd to Assets\Plugins\WSA ( in the inspector pane I choose WSAPlayer and placeholer to winsdkfb.dll)
    • Create C# script
    • add "using winsdkfb"
    But the IDE (VS 2017) can't read/found the winsdkfb
    upload_2021-5-23_21-16-25.png

    I use:
    Unity 2020.3.6f1
    Visual Studio Community 2017
    winsdkfb 0.15.0

    Here is my ss all my configuration in Unity
    upload_2021-5-23_21-15-25.png
    upload_2021-5-23_21-15-51.png
    upload_2021-5-23_21-17-9.png
    upload_2021-5-23_21-17-29.png

    Please help me.
    Or do you guys have better solution without winsdkfb ?

    thank you very much for your attention.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    You might have to wrap the usage in "#if UNITY_WSA && ENABLE_WINMD_SUPPORT". Also, change the scripting backend to Any since UWP is currently an IL2CPP only platform.
     
  3. rekatha

    rekatha

    Joined:
    Dec 18, 2017
    Posts:
    22
    Thank you for your advice
    I try to use the define but code inside ENABLE_WINMD_SUPPORT is grey out. I try to add Debug.Log inside it and the log not appear.
    Changing scripting backend to Any also doesn't resolve the issue

    I think winsdkfb from nuget.org doesn't run same runtime with unity runtime
     
    Last edited: May 25, 2021
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    It's grayed out because that define is only active when you build a UWP player. It will not execute in the editor.
     
  5. rekatha

    rekatha

    Joined:
    Dec 18, 2017
    Posts:
    22
    I try build UWP and get this error message

    winsdkfb.dll' could not be opened -- PE image doesn't contain managed metadata


    EDIT:
    I can remove this error by remove placeholer, IDK if this is the correct way.
     
    Last edited: May 25, 2021
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Yes it is.
     
    rekatha likes this.
  7. rekatha

    rekatha

    Joined:
    Dec 18, 2017
    Posts:
    22
    thank you for your confirmation