Search Unity

Facebook SDK for Unity - Plus Windows Phone 8

Discussion in 'Windows' started by zeezeezee, Dec 17, 2013.

  1. reklass

    reklass

    Joined:
    Jan 23, 2014
    Posts:
    4
    Has anyone had success integrating the windows sdk for facebook or is there an alternate plugin that might work? The one's on the asset store have some mixed reviews, and I'm not 100% sure how to go about integrating the C++ sdk into my current project.
     
  2. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    763
  3. Doppio_movimento

    Doppio_movimento

    Joined:
    Jan 9, 2016
    Posts:
    12
    What exactly do you mean by this? What do the fake libraries look like? I'm trying to get this to work with the UWP SDK, but I've had no luck.
     
  4. kujo

    kujo

    Joined:
    Aug 19, 2013
    Posts:
    106

    That looks interesting. I keep getting moved away from Windows with other more urgent matters, so I haven't had much success getting this working nicely on Win10 yet. Only thing I'm not sure with this implementation is how it'd play nicely with the normal FB SDK, might need a bit of reworking
     
  5. Doppio_movimento

    Doppio_movimento

    Joined:
    Jan 9, 2016
    Posts:
    12
    I think I got the DLL/WINMD issues resolved, but when I compile for UWP I get two errors in FB.cs

    Code (Log):
    1. The name 'Security' does not exist in the current context
    2. 'Type' does not contain a definition for 'GetMethod' and no extension method 'GetMethod' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)
     
  6. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    That is the code you have to update.
    For GetMethod you can use WinRTLegacy.TypeExtensions.GetMethod(). For Security namespace stuff you have to look for replacement.
     
  7. PixelSquad

    PixelSquad

    Joined:
    Sep 4, 2014
    Posts:
    114
    Hi guys. The solution we went for is the Ersin plugin - it works well on Windows 8 and WSA.

    The only problem we found so far is we're getting the following error when trying to share a link on Windows 10. I wonder if anyone came across it before and what was done to solve it.

    "We can't connect to the service you need right now. Check your network connection or try this again later."

    Edit: just clarifying, the login dialog works fine.
     

    Attached Files:

    Last edited: May 14, 2016
  8. fishbrainz

    fishbrainz

    Joined:
    Nov 27, 2013
    Posts:
    12
    Hello,

    So i've been struggling with getting Facebook to work on Windows Phone 8.1, so far following @kujo 's notes but to no satisfactory results.

    I've been getting constant crashes on the await line in this snippet, that i can't seem to get past.

    Code (CSharp):
    1.  await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
    2.                  {
    3.                     FBResult res =  await FBSession.ActiveSession.LoginAsync(permissions);
    4.                      this.SetFBResult(res);
    5.                  });
    Tried also with
    Previously i've had errors on this same line but with different methods to call the LoginAscyn on the main UI thread, at least then the output in VS was saying something unity-vs-debug-arm-output.png (this was before i found this thread talking about winsdkfb for Unity WSA).

    Now the app just crashes at the same line as before only with no output, the debugger isn't catching anything.

    I've dug in the phone's debug .dmp file and found:

    Dump Summary
    ------------
    Dump File: myapp.dmp
    Last Write Time: 20.05.2016 17:25:05
    Process Name: .exe
    Process Architecture: ARM
    Exception Code: 0xC0000005
    Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
    Heap Information: Present

    System Information
    ------------------
    OS Version: 6.3.9651
    CLR Version(s): 4.0.30730.1

    After a quick google search (source) i found out i should make Thread-Safe calls, but i dont quite graps the notion. Any sudgestions here?

    Has anyone else experienced this issue?

    Any help is appreciated!

    Thx.
     
  9. kujo

    kujo

    Joined:
    Aug 19, 2013
    Posts:
    106
    To be honest - I've given up trying with it for now - I've sunk far too many hours into trying to get it to work and its causing me nothing but problems. There are quite a few 'solutions' online for it, but they are for non-Unity apps and I don't know enough Windows programming to get them to work.

    Here's hoping Facebook or Microsoft release something decent that works soon!
     
  10. fishbrainz

    fishbrainz

    Joined:
    Nov 27, 2013
    Posts:
    12
    I'm on a deadline, and this Facebook integration is eating too many hours of dev time so far...

    If anyone has any insights on this problem, it would be very much appreciated if they shared it!

    Another solution i've found is through the prime31 plugins, has anyone worked with this before? Does it work, or is it another dead end?

    Thx,

    F.
     
  11. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    159
    Hey Hi!
    Are you still supporting this platform ?